15.04.2015, 02:27
hi i tried to make if the id have wanted level, the police can give a ticket for the id (wanted player).. when police give a ticket to id (wanted player) the id money is lose $10.000
this is my code
but the code when i type "/ticket 1 killing" it say "** you can't give ticket to yourself " can someone fix this plz
this is my code
Код:
CMD:ticket(playerid, params[]) { new id, reason, str[120], x,y,z; if(pInfo[playerid][pFaction] == 1) { if(Duty[playerid] == 1) { if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "** /ticket [playerid] [reasonn]"); if(id == playerid) return SendClientMessage(playerid, -1, "** you can't give ticket for yourself"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "** that player is not connected"); if(pInfo[playerid][pFacrank] < pInfo[id][pFacrank]) return SendClientMessage(playerid, -1, "** you can't give ticket for high rank"); if(!IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z) && GetPlayerInterior(playerid) == GetPlayerInterior(id) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(id)) return SendClientMessage(playerid, -1, "** you must near the wanted player"); if(GetPlayerWantedLevel(id) == 0) return SendClientMessage(playerid, -1, "** that player have no wanted level"); GivePlayerMoney(id, -10000); SetPlayerWantedLevel(id, 0); format(str, sizeof(str), "[POLICE]: {FFFFFF}Players %s telah ditilang oleh pak polisi %s karena %s", id, GetName(playerid), reason); SendClientMessageToAll(COLOR_BLUE, str); SendClientMessage(id, -1, "** Kau telah ditilang dan harus membayar sebesar {FF0000}$10.000"); format(str, sizeof(str), "[POLICE]: Kau telah menilang %s dan mendapatkan uang sebesar {00FF00}$1000 {FFFFFF}dan 1 score point", id); SendClientMessage(playerid, -1, str); GivePlayerMoney(playerid, 1000); SetPlayerScore(playerid, GetPlayerScore(playerid)+1); } else return SendClientMessage(playerid, -1, "** you must ON Duty"); } else return SendClientMessage(playerid, -1, "** you are not police"); return 1; }