03.04.2011, 21:37
I want to make a Admin Duty for my server post it here if you have any good ideas!
new aDuty[MAX_PLAYERS];
CMD:aduty(playerid,params[])
{
if(aDuty[playerid] == 0)
{
aDuty[playerid] = 1;
SendClientMessageToAll(-1," --- An administrator is now ON DUTY!!");
}
else
{
aDuty[playerid] = 0;
SendClientMessageToAll(-1," --- An administrator is now OFF DUTY!!");
}
}
new adminduty[MAX_PLAYERS];
if(strcmp(cmd, "/adminduty", true) == 0)
{
if (adminlevel[playerid] >= 1)// EDIT THIS
{
if(adminduty[playerid] == 1)
{
GetPlayerName(playerid, nameee, sizeof(nameee));
format(string, sizeof(string), "%s is now off admin duty!", nameee);
SendClientMessageToAll(0xFF0000FF, string);
adminduty[playerid] = 0;
SetPlayerHealth(playerid, 0.0);
}
else if(adminduty[playerid] == 0)
{
GetPlayerName(playerid, nameee, sizeof(nameee));
format(string, sizeof(string), "%s is now on admin duty!", nameee);
SendClientMessageToAll(0xFF0000FF, string);
SetPlayerColor(playerid, 0x9ACD32AA);
adminduty[playerid] = 1;
}
}
else SendClientMessage(playerid, RED, "You are not an admin!");
return 1;
}
C:\Documents and Settings\Korisnik\Desktop\G.R.P\filterscripts\commands.pwn(113) : error 017: undefined symbol "cmd" C:\Documents and Settings\Korisnik\Desktop\G.R.P\filterscripts\commands.pwn(115) : error 017: undefined symbol "adminlevel" C:\Documents and Settings\Korisnik\Desktop\G.R.P\filterscripts\commands.pwn(115) : warning 215: expression has no effect C:\Documents and Settings\Korisnik\Desktop\G.R.P\filterscripts\commands.pwn(115) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Korisnik\Desktop\G.R.P\filterscripts\commands.pwn(115) : error 029: invalid expression, assumed zero C:\Documents and Settings\Korisnik\Desktop\G.R.P\filterscripts\commands.pwn(115) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
new AdminOnDuty[MAX_PLAYERS]
CMD:admindutyon(playerid, params[])
{
if(IsPlayerAdmin(playerid))
if(AdminOnDuty[playerid] == 1) return SendClientMessage(playerid,0xAA3333AA, "You're already on Adminstrator duty, Type /AdminDutyOff to OFF your duty!");
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
new string[128];
AdminOnDuty[playerid] = 1;
format(string,sizeof(string), "Adminstrator %s is now on Admin duty.", pName);
SendClientMessageToAll(0x33CCFFAA, string);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You're not an adminstrator to use this cmd");
}
return 1;
}
CMD:admindutyoff(playerid, params[])
{
if(IsPlayerAdmin(playerid))
if(AdminOnDuty[playerid] == 0) return SendClientMessage(playerid,0xAA3333AA, "You're already off Adminstrator Duty, Type /AdminDutyOn to ON your duty!");
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
new string[128];
AdminOnDuty[playerid] = 0;
format(string,sizeof(string), "Adminstrator %s is no longer on Adminstrator duty.", pName);
SendClientMessageToAll(0x33CCFFAA, string);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You're not an adminstrator to use this cmd");
}
return 1;
}