06.12.2010, 14:36
I made a command :
But it gives me the error :
I want if that player is in that point to deposit their drugs they're carring
pawn Код:
if(strcmp(cmd, "/depositdrugs", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /deposit [amount]");
return 1;
}
giveplayerid = strval(tmp);
if (PlayerToPoint(8, playerid,364.1431,173.7478,1008.3828))
{
if(giveplayerid <= DrugsAmount && giveplayerid >= 0)
{
format(string, sizeof(string), "You have deposited %d$ into your drug store.",giveplayerid);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerMoney(playerid, -giveplayerid);
PlayerInfo[playerid][pDrugs] = PlayerInfo[playerid][pDrugs]+giveplayerid;
DrugsAmount[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_RED,"You do not have that drugs in your pocket.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"You must be at the drug store to do this command.");
}
return 1;
}
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(9349) : error 033: array must be indexed (variable "DrugsAmount")