14.09.2011, 15:17
Hello SA-MP players. Well I have a Question "we" made a drug system for my server and all works good, but there is one problem with the /give command. After you baught the drugs and all, it shows that you got the drug(lets take cocaine for example), and the /give command allows you to transfer the cocaine you got to another player, but when you do /givecocain nothing appears and nothing happends, can someone maybe help here:
-Thank you.
Код:
dcmd_givecocaine(playerid, params[])//COCAINE { GetPlayerPos(id,xd,yd,zd); if(IsPlayerInRangeOfPoint(playerid,5.0,xd,yd,zd)) { if(Cocaine[playerid]== 1) { if (sscanf(params, "dz", id, reason)) SendClientMessage(playerid, COLOR_BLUE, "Usage: \"/givecocaine [playerid]\""); else if(!IsPlayerConnected(id))SendClientMessage(playerid, COLOR_BLUE, "Invalid id"); else { 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); //seller ApplyAnimation(id,"DEALER","DEALER_IDLE_02",4.1,0,1,1,1,1,1);//buyer Cocaine[playerid] = 0; Cocaine[id] = 1; SendClientMessage(id, COLOR_GREEN, "you have drugs, now jizz with /usedrugs or sell it further to other people"); } } SendClientMessage(playerid, 0xC20000FF, "You dont have any drugs to sell"); } return 1; }