14.09.2011, 15:25
PHP код:
dcmd_givecocaine(playerid, params[])
{
new id;
if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_BLUE,"Usage: /givecocaine [Playerid / name]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_BLUE,"Invalid id");
GetPlayerPos(id, xd, yd, zd);
if(!IsPlayerInRangeOfPoint(playerid,5.0,xd, yd, zd)) return SendClientMessage(playerid, COLOR_BLUE,"You are not near that player");
if(Cocaine[playerid] != 1) return SendClientMessage(playerid, 0xC20000FF, "You don't have any drugs to sell");
SendClientMessage(playerid, COLOR_GREEN, "You gave the other player some cocaine");
ApplyAnimation(playerid,"DEALER","DEALER_IDLE_01",4.1,0,1,1,1,1,1);
ApplyAnimation(id,"DEALER","DEALER_IDLE_02",4.1,0,1,1,1,1,1);
Cocaine[playerid] = 0;
Cocaine[id] = 1;
SendClientMessage(id, COLOR_GREEN, "you have drugs, now jizz with /usedrugs or sell it further to other people");
return 1;
}

