12.02.2018, 11:30
Quote:
number of arguments means that you messed a param there, i assume its the ammo one, you used GivePlayerValidWeapon which is as i assume an anti weapon cheat, you did giveplayerid and weaponid but you forgot to add the ammo.
|
PHP код:
hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
new string[128];
if(dialogid == DIALOG_REVERSE) {
new rPlayerID = GetPVarInt(playerid, "ReverseFromID");
new releasedID = GetPVarInt(rPlayerID, "ReverseID");
if(response) {
if(PlayerInfo[releasedID][pJailedInfo][1] > 0) GivePlayerCash(releasedID, PlayerInfo[releasedID][pJailedInfo][1]);
if(PlayerInfo[releasedID][pJailedInfo][3] == 1) PlayerInfo[releasedID][pWarns]--;
format(string, 128, "AdmCmd: %s(%d) has been released from prison (/reverse) by %s, reason: Reversed (%s)", GetPlayerNameEx(releasedID), GetPlayerSQLId(releasedID), GetPlayerNameEx(playerid), GetPlayerNameEx(rPlayerID));
Log("logs/admin.log", string);
format(string, 128, "AdmCmd: %s has been released from prison by %s, reason: Reversed (%s)", GetPlayerNameEx(releasedID), GetPlayerNameEx(playerid), GetPlayerNameEx(rPlayerID));
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
//PlayerInfo[releasedID][pWantedLevel] = 0;
PlayerInfo[releasedID][pBeingSentenced] = 0;
SetPlayerToTeamColor(releasedID);
SetHealth(releasedID, 100);
//SetPlayerWantedLevel(releasedID, 0);
PlayerInfo[releasedID][pJailTime] = 0;
SetPlayerPos(releasedID, 1529.6,-1691.2,13.3);
SetPlayerInterior(releasedID,0);
PlayerInfo[releasedID][pInt] = 0;
SetPlayerVirtualWorld(releasedID, 0);
PlayerInfo[releasedID][pVW] = 0;
strcpy(PlayerInfo[releasedID][pPrisonReason], "None", 128);
SetPlayerToTeamColor(releasedID);
for(new x = 0; x < 12; x++) GivePlayerValidWeapon(releasedID, PlayerInfo[releasedID][pJailedWeapons][x]);
for(new y = 0; y < 5; y++) PlayerInfo[releasedID][pJailedInfo][y] = 0;
for(new z = 0; z < 12; z++) PlayerInfo[releasedID][pJailedWeapons][z] = 0;
SendClientMessageEx(releasedID, COLOR_LIGHTBLUE, "Your punishment has been reversed by the administrator who jailed you.");
}
else {
format(string, 128, "Administrator %s has denied your request to reverse your action.", GetPlayerNameEx(playerid));
SendClientMessageEx(rPlayerID, COLOR_RED, string);
}
DeletePVar(playerid, "ReverseFromID");
DeletePVar(rPlayerID, "ReverseReason");
DeletePVar(rPlayerID, "ReverseID");
}
return 0;
}