I made admin commands which i have tested and working fine in my localhost(my pc), and when i upload it to my host the admin command work for some time and does not work for some time and again it works... strangely i cannot find were the problem arises.... it is possibly due to lags or something i dunno....
Код:
CMD:spec(playerid,params[])
{
new giveplayerid;
if(LoggedIn[playerid] == 1)
{
if(AdminLevel{playerid} >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
//if(AdminLevel{giveplayerid} == MaxAdminLevel && AdminLevel{playerid} != MaxAdminLevel) return SendLangMessage(playerid,_COLOR_RED,"Du kannst diesen Command nicht bei diesen Admin benutzen !","You cannot use this command on this admin !","No puedes usar este comando en este administrador !");
if(sscanf(params,"i",giveplayerid)) return SendLangMessage(playerid,_COLOR_WHITE, "Benutzung: /spec [ID]","Usage: /spec [id]","Uso: /spec [id]");
if(giveplayerid == playerid) return SendLangMessage(playerid, _COLOR_RED, "Du kannst dich nicht selber specen!","You can not spec yourself!","Ya no estas observando.");
CMDMessageToAdmins(playerid,"SPEC");
if(GetPVarInt(playerid,"undercover") == 0)
{
foreach(Player,i)
{
if(reportedid[i] == giveplayerid)
{
SendLangMessage(i,admblue,"Adminstratoren haben angefangen deine Meldung zu ьberprьfen.","Adminstrators have started to check your report.","Los administradores han empezado a revisar tu reporte.");
reportedid[i] = -1;
}
}
}
if(specing[playerid] == 0)
{
GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);
GetPlayerFacingAngle(playerid,Pos[playerid][3]);
new Float:Health,Float:Armour;
GetPlayerHealth(playerid,Health);
GetPlayerArmour(playerid,Armour);
p_healtharmour[playerid][p_health] = Health;
p_healtharmour[playerid][p_armour] = Armour;
if(SpawnKillProtected[playerid]) spawndata[playerid][spawnkill_protection] = 1;
spawndata[playerid][p_world] = GetPlayerVirtualWorld(playerid);
for(new i; i < 13; i++)
{
GetPlayerWeaponData(playerid,i,spawndata[playerid][p_weapons][i],spawndata[playerid][p_ammo][i]);
}
storerespawn[playerid] = 1;
}
TextDrawHideForPlayer(playerid,teamselection[playerid]);
StartSpectate(playerid, giveplayerid);
SendLangMessage(playerid,admblue,"Du specst jetzt!","You are specing now!","Ahora estas observando!");
}
else return SendLangMessage(playerid, _COLOR_RED2, "Diese ID existiert nicht !","This ID does not exist !","Esta ID no existe.");
}
else return SendLangMessage(playerid, _COLOR_RED2, "Du hast keine Berechtigung dafьr!","You are not authorized to use this command!","No estas autorizado a usar este comando");
}
else return SendLangMessage(playerid, _COLOR_RED2, "Du musst eingeloggt sein!","You must be logged in!","Debes estar identificado!");
return 1;
}
there must be no error in my code..... any other issues which is known??
Download & Run the Crashdetector Plugin and compile your script with the -d3 debug mode on (Create pawn.cfg inside the pawno folder and type in -d3 inside it).