Quote:
Originally Posted by Skyld
Why not just do it all serverside? There is nothing there that needs to be clientside at all.
|
^Right, take a look at these:
PHP Code:
function onActionServerSide()
{
if (params[0] == "PurchaseItem")
{
switch(params[1])
{
case "Juggling":
if (clientr.etcoins >= 30)
{
clientr.etcoins -= 30;
addweapon("*Prizes/Juggle");
}
else
{
player.chat = "Insufficient funds!";
}
break;
}
}
}
//#CLIENTSIDE
function onPlayerChats()
{
tokens = player.chat.tokenize();
if (tokens[0] == "buy")
{
this.t_chat = tokens.substring(4);
switch(this.t_chat)
{
case "Juggling":
triggerserver("gui",name,"PurchaseItem","Juggling");
break;
}
}
}
Compared to:
PHP Code:
function onPlayerChats()
{
tokens = player.chat.tokenize();
if (tokens[0] == "buy")
{
this.t_chat = tokens.substring(4);
switch(this.t_chat)
{
case "Juggling":
if (clientr.etcoins >= 30)
{
clientr.etcoins -= 30;
addweapon("*Prizes/Juggle");
}
else
{
player.chat = "Insufficient funds!";
}
break;
}
}
}
Get the picture?