22.08.2015, 17:12
Warnings:
Codes:
PHP код:
NPP_EXEC: "Pawno Comp."
NPP_SAVE: C:\Users\sekseriic\Desktop\dwrp_server\gamemodes\dwrp_mode.pwn
CD: C:\Users\sekseriic\Desktop\dwrp_server\gamemodes
Current directory: C:\Users\sekseriic\Desktop\dwrp_server\gamemodes
"C:\Users\sekseriic\Desktop\dwrp_server\pawno\pawncc.exe" "dwrp_mode.pwn" -; -(
Process started >>>
dwrp_mode.pwn(386) : warning 203: symbol is never used: "AccessDenied"
dwrp_mode.pwn(386) : warning 203: symbol is never used: "GetAdminLevelName"
dwrp_mode.pwn(386) : warning 203: symbol is never used: "SendAdminMessage"
dwrp_mode.pwn(386) : warning 203: symbol is never used: "SendErrorMessage"
dwrp_mode.pwn(386) : warning 203: symbol is never used: "SendSyntaxMessage"
dwrp_mode.pwn(386) : warning 203: symbol is never used: "setadminlevel"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Warnings.
<<< Process finished. (Exit code 0)
================ READY ================
PHP код:
AccessDenied(playerid)
{
return SendServerMessage(playerid, "Access denied!");
}
PHP код:
GetAdminLevelName(i)
{
new tmpString[32];
switch (i)
{
case 0: format(tmpString, sizeof(tmpString), "Regular Player");
case 1: format(tmpString, sizeof(tmpString), "Trial Admin");
case 2: format(tmpString, sizeof(tmpString), "Admin");
case 3: format(tmpString, sizeof(tmpString), "Super Admin");
case 4: format(tmpString, sizeof(tmpString), "Lead Admin");
case 5: format(tmpString, sizeof(tmpString), "Head Admin");
case 1337: format(tmpString, sizeof(tmpString), "Scripter");
default: format(tmpString, sizeof(tmpString), "Undefined Admin");
}
return tmpString;
}
PHP код:
SendAdminMessage(playerid, message[])
{
new msg[256+1];
format(msg,256,"[{CB99C9}admin{EEEEEE}] %s", message);
SendClientMessage(playerid, color_white, msg);
}
PHP код:
SendErrorMessage(playerid, message[])
{
new msg[256+1];
format(msg,256,"[{FF6961}error{EEEEEE}] %s", message);
SendClientMessage(playerid, color_white, msg);
}
PHP код:
SendSyntaxMessage(playerid, message[])
{
new msg[256+1];
format(msg,256,"[{03C03C}syntax{EEEEEE}] %s", message);
SendClientMessage(playerid, color_white, msg);
}
PHP код:
CMD:setadminlevel(playerid, params[])
{
new targetid, level, str[128];
if (playerData[playerid][adminlevel] >= 5) {
if (sscanf(params, "ui", targetid, level))
return SendSyntaxMessage(playerid, "/setadminlevel [playerid/name] [adminlevel (0-5)]");
else if (!IsPlayerLoggedIn(targetid))
return SendErrorMessage(playerid, "Player's id or name is invalid.");
else if (level < 0 || level > 5)
return SendErrorMessage(playerid, "Entered adminlevel is invalid.");
format(str, sizeof(str), "Player's [%s] admin level has been changed to %i [%s].", GetPlayerNameEx(targetid), level, GetAdminLevelName(level));
SendAdminMessage(playerid, str);
format(str, sizeof(str), "[%s] %s has changed your admin level to %i.", GetAdminLevelName(playerData[playerid][adminlevel]), GetPlayerNameEx(playerid), level);
SendAdminMessage(targetid, str);
playerData[targetid][adminlevel] = level;
} else {
AccessDenied(playerid);
}
return 1;
}