30.10.2015, 15:27
Код:
enum pTaxi { pDutyTaxi }; new Playerinfos[MAX_PLAYERS][pTaxi]; CMD:dutyta(playerid,params[]) { SendClientMessage(playerid,-1,"You are ON DUTY for TAXI driver"); Playerinfos[playerid][pDutyTaxi] = 1; return 1; } CMD:setfee(playerid,params[]) { if(Playerinfos[playerid][pDutyTaxi] == 1) { new fare,id; if(sscanf(params,"dd",id,fare)) return SendClientMessage(playerid,-1,"/setfee <playerid> <fare>"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Player is not connected"); new Float:x ,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); if(!IsPlayerInRangeOfPoint(playerid,1,x,y,z)) { GivePlayerMoney(id,-fare); GivePlayerMoney(playerid,fare); new Float:xx,Float:yy,Float:zz; GetPlayerPos(playerid,xx,yy,zz); if(!IsPlayerInRangeOfPoint(playerid,1,xx,yy,zz)) { GivePlayerMoney(id,-fare); GivePlayerMoney(playerid,fare); } } } return 1; }