02.06.2010, 06:42
Well, right now, all you need to do is add one more tmp.
Код:
dcmd_dealweed(playerid, params[])
{
if(PlayerInfo[playerid][Drugs] >= 1)
{
new tmp[25], tmp2[25],tmp3[25], Index,amount,price;
tmp = strtok(params,Index),
tmp2 = strtok(params,Index);
tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid, red, "USAGE: /dealweed [playerid]");
new player1,playername[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
amount=strval(tmp2);
price= strval(tmp3);
GetPlayerName(player1,playername,sizeof(playername));
format(string,sizeof(string),"You gave %s %d weed",playername,amount);
SendClientMessage(playerid,red,string);
PlayerInfo[player1][GSF] += amount;
SendClientMessage(player1,red,"You have +%d weed",amount);
GivePlayerMoney(playerid,GetPlayerMoney(playerid)+price);
GivePlayerMoney(player1,GetPlayerMoney(playerid)-price);
}
else SendClientMessage(playerid,red,"You don't have weed");
return 1;
}
}

