if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true)) // Original by Kurnia Rocki
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerColor(playerid,0xFF000000);
SetPlayerName(playerid, PlayerInfo[playerid][pAdminname]);
format(string, sizeof(string),"Admin: %s is now on Admin Duty", name);
ABroadCast(COLOR_LIGHTRED, string, 1);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SetPlayerColor(playerid,0xFF000000); // Senior Admin Colour (Dark Red)
SetPlayerSkin(playerid, 294);
new Float:AX,Float:AY,Float:AZ;
GetPlayerPos(playerid, AX,AY,AZ);
SafeSetPlayerPos(playerid, AX,AY,AZ+1);
UpdatePlayerPosition(playerid);
SetPlayerHealth(playerid, 99999);
SetPlayerArmour(playerid, 99999);
}
if(PlayerInfo[playerid][pAdmin] >= 6)
{
SaveGuns(playerid);
SafeResetPlayerWeapons(playerid);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1000);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1000);
}
return 1;
}
else if(PlayerInfo[playerid][pAdminDuty] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 6)
{
if(Spectate[playerid] == 255)
{
SafeResetPlayerWeapons(playerid);
SetPlayerWeapons(playerid);
}
SetPlayerSkills(playerid);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
PlayerInfo[playerid][pAdminDuty] = 0;
new originalskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, originalskin);
SetPlayerName(playerid, sendername);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
SafeSetPlayerPos(playerid, X,Y,Z+1);
SetPlayerToTeamColor(playerid);
format(string, sizeof(string),"Admin: %s is now off Admin Duty", sendername);
ABroadCast(COLOR_LIGHTRED, string, 1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /adminduty",d,m,y,h,mi,s,sendername);
AdminLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "** You're not an admin !");
return 1;
}
}
return 1;
}
What is that "something wrong"? or better if I will use my telekinetic power?
|
SetPlayerName(playerid, PlayerInfo[playerid][pAdminname]);