26.12.2013, 13:44
I need someone to convert from strcmp to zcmd (cmd). I have some troubles i try but i failed so i wanna see the correct. Thanks.
pawn Код:
if(strcmp(cmd, "/sladoled", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 26)
{
SendClientMessage(playerid, COLOR_GREY, " You dont have the job!");
return 1;
}
new tmpcar = GetPlayerVehicleID(playerid);
if(IsASladCar(tmpcar))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "HELP: /sladoled [playerid/PartOfName] [cjena]");
return 1;
}
new money;
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
money = strval(tmp);
if(money < 1 || money > 50)
{
SendClientMessage(playerid, COLOR_GREY, " Price cant be lower than 1$ or more than!");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " You cant give a icecream to yourself !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You sold an iceccream to %s for $%d.", giveplayer, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* IceMan %s wants to sell you a $%d, (typej /accept sladoled) to accept.", sendername, money);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
IceCreamOffer[giveplayerid] = playerid;
IceCreamPrice[giveplayerid] = money;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " The player is not near you!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " The player is offline.!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a Ice-cream Truck.");
return 1;
}
}
return 1;
}