05.06.2009, 21:36
using strtok:
pawn Код:
if(strcmp(cmd,"/Buyseed",true)==0)
{
SendClientMessage(playerid,0x00FF00AA,"You need to choose which seed to buy! Choose: /Buy Seed (Seed Number)");
SendClientMessage(playerid,0x00FF00AA,"Seed Types: 1- Cucumber, 2- Carrot, 3- Tomatoes");
tmp=strtok(cmdtext,idx);
if(strcmp(tmp,"1",true)==0)
{
SendClientMessage(playerid,0x00FF00AA,"You have bought Cucumber seeds!");
}
if(strcmp(tmp,"2",true)==0)
{
SendClientMessage(playerid,0x00FF00AA,"You have bought Carrot seeds!");
}
if(strcmp(tmp,"3",true)==0)
{
SendClientMessage(playerid,0x00FF00AA,"You have bought Tomatoes seeds!");
}
return 1;
}