09.05.2014, 02:18
I make a command here ..
And here's the /release
But i'am getting this error how to fix this ?
pawn Код:
CMD:nrprison(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
new string[128], giveplayerid, minutes, reason[64];
if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /nrprison [playerid/partofname] [minutes] [reason]");
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && AdminDuty[giveplayerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level admin that is on-duty.");
return 1;
}
if(strlen(reason) >= 25)
{
SendClientMessage(playerid, COLOR_WHITE, "Please provide a shorter reason. The maximum length for a prison reason is 25.");
return 1;
}
nr[giveplayerid] = 1;
/*if(GetPVarInt(giveplayerid, "PBM") > 0)
{
LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
}*/
GameTextForPlayer(giveplayerid, "~w~Welcome to ~n~~r~Admin Prison", 5000, 3);
ResetPlayerWeaponsEx(giveplayerid);
format(string, sizeof(string), "AdmCmd: %s has been NR silent prisoned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
Log("logs/admin.log", string);
format(string, sizeof(string), "AdmCmd: %s has been NR prisoned by an Admin, reason: %s", GetPlayerNameEx(giveplayerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pWantedLevel] = 0;
SetPlayerWantedLevel(giveplayerid, 0);
PlayerInfo[giveplayerid][pJailed] = 3;
PlayerInfo[giveplayerid][pJailTime] = minutes*60;
format(PlayerInfo[giveplayerid][pPrisonReason], 128, "%s", reason);
format(PlayerInfo[giveplayerid][pPrisonedBy], MAX_PLAYER_NAME, "%s", GetPlayerNameEx(playerid));
PhoneOnline[giveplayerid] = 1;
TogglePlayerControllable(giveplayerid, 0);
for(new o = 0; o < 6; o++)
{
TextDrawShowForPlayer(giveplayerid, ObjectsLoadingTD[o]);
}
SetPVarInt(giveplayerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 3000, 0, "d", giveplayerid);
SetPlayerInterior(giveplayerid, 69);
PlayerInfo[giveplayerid][pVW] = 696969;
PlayerInfo[giveplayerid][pInt] = 69;
SetPlayerVirtualWorld(giveplayerid, 696969);
new rand = random(sizeof(AdminPrisonFloat));
SetPlayerPos(giveplayerid, AdminPrisonFloat[rand][0], AdminPrisonFloat[rand][1], AdminPrisonFloat[rand][2]);
SetPlayerSkin(giveplayerid, 50);
SetPlayerColor(giveplayerid, TEAM_APRISON_COLOR);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
}
return 1;
}
pawn Код:
CMD:release(playerid, params[])
{
new string[128], giveplayerid, reason[64];
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
return 1;
}
if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /release [playerid/partofname] [reason]");
if(PlayerInfo[playerid][pAdmin] != 6) return SendClientMessage(playerid, COLOR_REALRED, "Sorry but you can't release those jailed by using /nrprison, Contact a Admin level 6 to release him/her");
{
format(string, sizeof(string), "AdmCmd: %s has been released from NR prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
Log("logs/admin.log", string);
format(string, sizeof(string), "AdmCmd: %s has been released from NR prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pJailed] = 0;
PlayerInfo[giveplayerid][pWantedLevel] = 0;
SetPlayerToTeamColor(giveplayerid);
SetPlayerWantedLevel(giveplayerid, 0);
PlayerInfo[giveplayerid][pJailTime] = 0;
SetPlayerPos(giveplayerid, 1540.4144, -1673.2413, 13.5505);
SetPlayerInterior(giveplayerid,0);
PlayerInfo[giveplayerid][pInt] = 0;
SetPlayerVirtualWorld(giveplayerid, 0);
PlayerInfo[giveplayerid][pVW] = 0;
PhoneOnline[giveplayerid] = 0;
}
else
{
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
Log("logs/admin.log", string);
format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pJailed] = 0;
PlayerInfo[giveplayerid][pWantedLevel] = 0;
SetPlayerToTeamColor(giveplayerid);
SetPlayerWantedLevel(giveplayerid, 0);
PlayerInfo[giveplayerid][pJailTime] = 0;
SetPlayerPos(giveplayerid, 1540.4144, -1673.2413, 13.5505);
SetPlayerInterior(giveplayerid,0);
PlayerInfo[giveplayerid][pInt] = 0;
SetPlayerVirtualWorld(giveplayerid, 0);
PlayerInfo[giveplayerid][pVW] = 0;
PhoneOnline[giveplayerid] = 0;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
}
return 1;
}
pawn Код:
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\El Pilipinas Roleplay v5\gamemodes\XGAMING.pwn(24482) : error 017: undefined symbol "nr"
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\El Pilipinas Roleplay v5\gamemodes\XGAMING.pwn(24482) : warning 215: expression has no effect
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\El Pilipinas Roleplay v5\gamemodes\XGAMING.pwn(24482) : error 001: expected token: ";", but found "]"
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\El Pilipinas Roleplay v5\gamemodes\XGAMING.pwn(24482) : error 029: invalid expression, assumed zero
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\El Pilipinas Roleplay v5\gamemodes\XGAMING.pwn(24482) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.