09.12.2014, 16:51
Command:
It sends *Steve opens their trunk and takes 15 grams of cocaine from it. 4 times, but why it sends the message 4 times ?
PHP код:
else if(!strcmp(option, "cocaine", true, 4))
{
if(sscanf(params, "s[32]i", option, amount)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /twithdraw cocaine [amount]");
if(PlayerInfo[playerid][pvTcocaine] < amount) return SendClientMessage(playerid, COLOR_GREY, "You don't have that much cocaine in your trunk.");
PlayerInfo[playerid][pvTcocaine] -= amount;
PlayerInfo[playerid][pcocaine] += amount;
format(string, sizeof(string), "* %s opens their trunk and takes %d grams of cocaine from it.", RPN(playerid), amount);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}