Admin Duty Command -
State_Trooper - 29.10.2011
I need a /aduty command that goes like
Код:
CMD:kick(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 2)
{
new string[128], giveplayerid, reason[64];
if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid)
{
format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /kick a higher admin.", GetPlayerNameEx(playerid));
ABroadCast(COLOR_YELLOW,string, (PlayerInfo[playerid][pAdmin] == 1) ? (1) : (2));
Kick(playerid);
return 1;
}
else
{
new year, month,day;
getdate(year, month, day);
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
Log("logs/kick.log", string);
if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
Kick(giveplayerid);
}
return 1;
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}
But i want /aduty not /kick
Re: Admin Duty Command -
Azzeto - 29.10.2011
PHP код:
CMD:aduty(playerid,params[]){
new string[128];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_GRAY,"You're not an admin!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
SendClientMessageToAll(COLOR_GREEN,string);
SetPlayerHealth(playerid,500000);
SetPlayerColor(playerid,COLOR_CYAN);
PlayerInfo[playerid][pAdminDuty] = 1;
adminlabel[playerid] = Create3DTextLabel("Admin on duty\n Do Not Attack!", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(adminlabel[playerid], playerid, 0.0, 0.0, 0.7);
}
else
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
SendClientMessageToAll(COLOR_RED,string);
PlayerInfo[playerid][pAdminDuty] = 0;
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid,COLOR_WHITE);
SetPlayerHealth(playerid,0);
ForceClassSelection(playerid);
Delete3DTextLabel(adminlabel[playerid]);
}
return 1;
}
You'll also need this
PHP код:
stock GetName(playerid)
{
new Name[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, Name, sizeof(Name));
}
else
{
Name = "Disconnected/Nothing";
}
return Name;
}
Its from my gamemode, if it helped rep+?
Re: Admin Duty Command -
State_Trooper - 29.10.2011
C:\Users\User\Desktop\SAMP Scripts\GG\gamemodes\GG.pwn(58729) : error 017: undefined symbol "pAdminDuty"
C:\Users\User\Desktop\SAMP Scripts\GG\gamemodes\GG.pwn(58735) : error 017: undefined symbol "pAdminDuty"
C:\Users\User\Desktop\SAMP Scripts\GG\gamemodes\GG.pwn(5873

: error 017: undefined symbol "pAdminDuty"
C:\Users\User\Desktop\SAMP Scripts\GG\gamemodes\GG.pwn(58742) : error 017: undefined symbol "pAdminDuty"
Re: Admin Duty Command -
Azzeto - 29.10.2011
Heh, that was just from my line, you can just delete those lines if you dont want them, those just check if the player is on admin duty ( for my gamemode ) so yeah.. just delete the lines that say if(PlayerInfo[playerid][pAdminDuty] == 0)
Re: Admin Duty Command -
State_Trooper - 29.10.2011
Hey do you have teamspeak or something i can contact you on like MSN, Xfire or anything maybe we can trade and help eachother out a bit
Re: Admin Duty Command -
Azzeto - 29.10.2011
sampserver.clanvent.com:3740 is my teamspeak.
Re: Admin Duty Command -
Danish7 - 06.03.2014
*****
Re: Admin Duty Command -
XK - 06.03.2014
First of all this isnt an error it is warning and gamemode works even if there is warnings
And to fix this warning,search for : aduty then delete it because there is no use for it