06.03.2014, 12:05
I'm a new scripter when it comes to pawno..and various other things.. So as a test I wanted to make my own TDM server though I mainly use it for mapping.
I added a command that allows you to buy weapons but I couldn't figure out how to make it say if you didn't have enough cash you couldn't buy it. I tried two separate things bug got the same error
Any idea's on what I am doing wrong?
I added a command that allows you to buy weapons but I couldn't figure out how to make it say if you didn't have enough cash you couldn't buy it. I tried two separate things bug got the same error
PHP код:
if(GetPlayerMoney(playerid) >= 500)
{
if(strcmp("/shotgun", cmdtext, true, 10) == 0
{
GivePlayerMoney(playerid, -500);
GivePlayerWeapon(playerid, 25, 100);
SendClientMessage(playerid, COLOR_RED, "You have just bought a shotgun!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You do not have enough funds for this weapon!");
return 1;
}
}
/* The code on top I get the error "Invalid expression, assumed zero */
if (strcmp("/shotgun", cmdtext, true, 10) == GetPlayerMoney(playerid) >=0)
{
GivePlayerMoney(playerid, -500);
GivePlayerWeapon(playerid, 25, 100);
SendClientMessage(playerid, COLOR_RED, "You have just bought a shotgun!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You do not have enough funds for this weapon!");
return 1;
}
/* For this one I get "Tag mismatch" */