Author Topic: Game rating system. (Trying to make this client sided) FILES AVAILABLE!  (Read 7267 times)

Stop naming your files "azjh_NAME". It should follow the format "script_NAME" "weapon_NAME".

Stop naming your files "azjh_NAME". It should follow the format "script_NAME" "weapon_NAME".


Anything else?


Anything else?
Make sure it doesn't have the same problems as your previous add-on.

Make sure it doesn't have the same problems as your previous add-on.

Don't worry, it dosn't.

Tom

Would you like me to make a GUI?

Also, the 0 might confuse people, it should be 1-10 (even though I think 1-5 would be even better).

Would you like me to make a GUI?

Also, the 0 might confuse people, it should be 1-10 (even though I think 1-5 would be even better).

I suppose. (About the gui part)
But, did you get the add-on first? (So you know how it works so far?)

Tom

I suppose. (About the gui part)
But, did you get the add-on first? (So you know how it works so far?)
Yep, I DL'd the add-on. I think it looks fine.

Code: (Line 59) [Select]
if(!(%cansend == 1))
Would be better as:

Code: (Line 59) [Select]
if(%cansend != 1)
I think it would work either way, but the second is better syntax.

Code: (Line 59) [Select]
if(!(%cansend == 1))
Would be better as:

Code: (Line 59) [Select]
if(%cansend != 1)
I think it would work either way, but the second is better syntax.
Picky pick :<

Also there should be a better way around...


Code: [Select]
if(%message $= "1"){
%canr = 1;
}
if(%message $= "2"){
%canr = 1;
}
if(%message $= "3"){
%canr = 1;
}


ETC.



But, it's okay for now. I'm more consernd on fixing the webserver/webpage.

Tom

Code: (Line 65) [Select]
%http = new HTTPObject(LCallbacks);

You shouldn't create a new HTTPObject every time.
Do something like this: (untested)
Code: [Select]
if(!isObject(LCallbacks))
{
     %http = new HTTPObject(LCallbacks);
}
else
{
     %http = LCallbacks;
}

That would work, but I doubt it'd help too much.

That would work, but I doubt it'd help too much.

Nope it messed it up.
But I did make my code better:


Code: [Select]
function serverCmdrate(%client,%message)
{
%cansend = 0;


if(%message $= "0" || %message $= "1" || %message $= "2" || %message $= "3" || %message $= "4" || %message $= "5" || %message $= "6" || %message $= "7" || %message $= "8" || %message $= "9")
{
%cansend = 1;
}


if(%cansend != 1)
{
messageclient(%client,"","Invalid rating.");
}
else{

//Must be made every time
%http = new HTTPObject(LCallbacks);


%raz = %message;
%aq = "q=myvar1=abc&";
%cqt = %aq@"myvar2="@%raz;
%alfinz = %cqt@"&myvar3=";
%addre = "NOAV";
%addre = $Pref::Server::Name;
%alfieri = %alfinz@%addre@"&myvar4=";
%complez = %alfieri@%client.name;

%http.get("azjherben.org:80", "/bltosql.php", %complez);
}
}

Tom

If you're gonna make it every time, at least deleted it.

Oh wow.
Now how do I delete it exactly?

Code: [Select]
switch$(%message)
{
   case 1: %cansend = 1;
   case 2: %cansend = 1;
   case 3: %cansend = 1;
   ...
   case 9: %cansend = 1;
   case 10: %cansend = 1;
   default: %cansend = 0;
}
A server-side mod is abusable. It'd be really, really easy to just set up my server to send you a 10/10 rating every eight seconds with a random BL_ID to make mine appear the best.

A client-side mod doesn't work unless everyone has it - the ratings are a bit useless if only ten people out of the 13,000 or so Blockland currently has can rate it at all.