12.03.2015, 23:08
Hey, I ended up copying a cmd to gain some knowledge on how its supposed to look and have edited it , but I aint edited it enough, it was not on the zcmd processor and now I am getting a few errors, if you know what i should do, please help me
There is a chance this is a simple fix, I have a feeling there is another way to make this cmd with ZCMD without using "tmp" and "cmdtext"
Код:
(3921) : error 017: undefined symbol "tmp" (3921) : error 017: undefined symbol "cmdtext" (3922) : error 017: undefined symbol "tmp" (3930) : error 017: undefined symbol "tmp" (3931) : error 017: undefined symbol "tmp" (3931) : error 017: undefined symbol "cmdtext" (3932) : error 017: undefined symbol "tmp" (3933) : error 017: undefined symbol "tmp" (3935) : error 017: undefined symbol "tmp" (3935) : error 017: undefined symbol "cmdtext" (3936) : error 017: undefined symbol "tmp"
pawn Код:
CMD:sellmarijuana(playerid, params[])//Line 3912
{
if(IsPlayerConnected(playerid))
{
/*if(PlayerInfo[playerid][pJob] != 2)
{
SendClientMessage(playerid, -1, "ERROR: You are not a Drug Dealer!");
return 1;
}*/
tmp = strtok(cmdtext, idx);//Line 3921
if(!strlen(tmp))//Line 3922
{
SendClientMessage(playerid, -1, "USAGE: /selldrugs [playerid] [amount]");
return 1;
}
new sellpotstring[248];
new playa;
new needed;
playa = strval(tmp);//Line 3930
tmp = strtok(cmdtext, idx);//Line 3931
if(!strlen(tmp)) { return 1; }//Line 3932
needed = strval(tmp);
if(needed < 1 || needed > 50) { SendClientMessage(playerid, -1, "ERROR: Selling Marijuana can be only in limits of 1 gram to 50 grams."); return 1; }
tmp = strtok(cmdtext, idx);//Line 3935
if(!strlen(tmp)) { return 1; }//Line 3936
if(needed > PlayerInfo[playerid][pMarijuana]) { SendClientMessage(playerid, -1, "ERROR: You don't have that much!"); return 1; }
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, playa))
{
if(playa != playerid)
{
format(sellpotstring, sizeof(sellpotstring), "INFO: You have gave %s %d grams of drugs.", GetPlayerNameEx(playa), needed);
SendClientMessage(playerid, -1, sellpotstring);
format(sellpotstring, sizeof(sellpotstring), "INFO: %s has just gave you %d grams of drugs.", GetPlayerNameEx(playerid), needed);
SendClientMessage(playa, -1, sellpotstring);
PlayerInfo[playa][pMarijuana] += needed;
PlayerInfo[playerid][pMarijuana] -= needed;
PlayerPlayerActionMessage(playerid,playa,15.0,"Has just gave some drugs to");
}
else
{
SendClientMessage(playerid, -1, "ERROR: You can't sell yourself drugs!");
}
}
else
{
SendClientMessage(playerid, -1, "ERROR: You arn't near that player!");
}
}
}
else
{
SendClientMessage(playerid, -1, "ERROR: Invalid ID.");
}
}
return 1;
}//Line 3971