08.09.2015, 15:43
When a cop types /fine and the wanted player have to /pay how can i make it like that, but it's in dialog...
Код:
CMD:fine(playerid, params[]) { if(Team[playerid] <= 6) { if(!strlen(params)) return SendClientMessage(playerid, -1, "Usage: /ticket [Player Id]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(params); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { if(GetPlayerWantedLevel(player1) <= 1) { if(!IsPlayerInAnyVehicle(player1)) { if (GetDistanceBetweenPlayers(playerid, player1) < 10) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string,sizeof(string),"Officer %s has given you a ticket.",adminname); ShowPlayerDialog(player1, DIALOG_TICKET, DIALOG_STYLE_MSGBOX, string, "You can choose to pay or NOT to pay the ticket: \n•If you choose to pay (Costs $300), your wanted level \nwill decrease to zero. \n•If you choose NOT to pay, your wanted level \nwill increase to 2 stars.", "Pay", "Don't pay"); format(string, sizeof(string), "Officer %s has given %s a ticket", adminname, playername); //Copstats[playerid][Tickets]++; return SendClientMessageToAll(-1, string); } else return SendClientMessage(playerid, -1, "ERROR: You need to be close to the player to give him a ticket."); } else return SendClientMessage(playerid, -1, "ERROR: Player is in a vehicle!"); } else return SendClientMessage(playerid, -1, "ERROR: This player does not have 1 or more wanted level!"); } else return SendClientMessage(playerid, -1, "ERROR: Player not found"); } else return SendClientMessage(playerid, -1, "ERROR: You have to be a Cop to use this command"); }
Код:
CMD:pay(playerid, params[]) { new String[250]; format(String,sizeof(String),"You have paided your fines!", PlayerInfo[playerid][Fines]); SendClientMessage(playerid,-1,String); PlayerInfo[playerid][Fines] = 0; SetPlayerWantedLevel(playerid, 0); GivePlayerMoney(playerid, -PlayerInfo[playerid][Fines]); TextDrawHideForPlayer(playerid, Fine[playerid]); PlayerWanted(playerid); return 1; }