08.10.2010, 00:25
I'm having an issue with my command:
The compile is telling me:
error 017: undefined symbol "tmp"
error 017: undefined symbol "idx"
error 017: undefined symbol "tmp"
What I want is if the player doesn't type /hold and the item id.. it tells them the proper define. Also if the player types /hold burger, it'll actually put it in their hand.
pawn Код:
if (strcmp("/hold", cmdtext, true, 10) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW,"[USAGE:] /hold [itemname]");
return 1;
}
if (strcmp("burger", cmdtext, true, 10) == 0)
{
SetPlayerHoldingObject(playerid, 2880, 5);
}
}
if (strcmp("/holdhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "_______________________________________");
SendClientMessage(playerid, GREEN, "[FOOD:]");
SendClientMessage(playerid, COLOR_LIGHTYELLOW, " burger - pizza - burrito - pizzabox - sprunkcup - takeout");
SendClientMessage(playerid, GREEN, "[ALCOHOL:]");
SendClientMessage(playerid, COLOR_LIGHTYELLOW, " beer - beer2 - whiskey - wineglass");
SendClientMessage(playerid, GREEN, "[MISC:]");
SendClientMessage(playerid, COLOR_LIGHTYELLOW, " briefcase - hairdryer - scythe - record - backpack - boombox - moneybag");
return 1;
}
return 0;
error 017: undefined symbol "tmp"
error 017: undefined symbol "idx"
error 017: undefined symbol "tmp"
What I want is if the player doesn't type /hold and the item id.. it tells them the proper define. Also if the player types /hold burger, it'll actually put it in their hand.