23.03.2010, 14:02
Hello again, i have been trying to make a /buy command, it's almost done, but when someone type /buy, it just say that you dont got enough cash...
Can you see anything that is wrong?
Thanks
Код:
if(strcmp(cmd, "/buy", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(5.0,playerid,-28.0929,-89.9516,1003.5469))
{
if(IsLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You are not logged in yet.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, " USAGE: /buy [item]");
SendClientMessage(playerid, COLOR_WHITE, "1: Disposable Tools: $500");
return 1;
}
new item = strval(tmp);
if (item == 1 && GetPlayerMoney(playerid) < 500)
{
if(PlayerInfo[playerid][pTools] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased Disposable Tools for $500.");
GivePlayerMoney(playerid, - 500);
PlayerInfo[playerid][pTools] = 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You already have tools.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You dont have that much.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not at the 24-7 Store");
return 1;
}
}
return 1;
}
Thanks

