PDA

View Full Version : Why does my server shut down if i do this


Scripter12345
25/04/2012, 08:56 PM
Why does my server shut down if i do /adminduty and i have not choose my adminname or adminskin



CMD:setadminname(playerid, params[])
{
if(PlayerData[ID][AdminLevel] >= 1)
{
new string[128], newname[MAX_PLAYER_NAME];
if(sscanf(params, "s", newname)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /setadminname <name>");
format(string, sizeof(string), "You set your admin name to %s", newname);
SendClientMessage(playerid, COLOR_ORANGE, string);
PlayerData[playerid][AdminName] = newname;
adminNameCreated[playerid] = 1;
}
return 1;
}

CMD:setadminskin(playerid, params[])
{
if(PlayerData[ID][AdminLevel] >= 1)
{
new string[128], newskin;
if(sscanf(params, "i", newskin)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /setadminskin <skinid>");
format(string, sizeof(string), "You set your admin skin to %d", newskin);
SendClientMessage(playerid, COLOR_ORANGE, string);
PlayerData[playerid][AdminSkin] = newskin;
adminSkinEnabled[playerid] = 1;
}
return 1;
}

CMD:adminduty(playerid, params[])
{
if(PlayerData[ID][AdminLevel] >= 1)
{
if(PlayerData[ID][AdminDuty] == 0)
{
GetPlayerName(playerid, PlayerData[playerid][OriginalName], 24);
SetPlayerName(playerid, PlayerData[playerid][AdminName]);
PlayerData[playerid][OriginalSkin] = GetPlayerSkin(playerid);
if(adminSkinEnabled[playerid] == 0)
return SendClientMessage(playerid, COLOR_RED, "You have not set your admin skin, /setadminskin");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now on admin duty");
format(str2, sizeof(str2),"Admin %s Is now online",PlayerData[playerid][AdminName]);
SetPlayerSkin(playerid, PlayerData[playerid][AdminSkin]);
SetPlayerColor(playerid, COLOR_NAVY);
SendClientMessageToAll(COLOR_GREEN,str2);
}
else
{
if(PlayerData[ID][AdminDuty] == 1)
{
SetPlayerName(playerid, PlayerData[playerid][OriginalName]);
SetPlayerSkin(playerid, PlayerData[playerid][OriginalSkin]);
if(adminNameCreated[playerid] == 0)
return SendClientMessage(playerid, COLOR_RED, "You have not set your admin name, /setadminname");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now off admin duty");
format(str2, sizeof(str2),"Admin %s Is now offline",PlayerData[playerid][AdminName]);
SetPlayerColor(playerid, COLOR_WHITE);
SendClientMessageToAll(COLOR_GREEN,str2);
}
}
}
return 1;
}



Thank You


Please Help Me Please

Elysian`
25/04/2012, 08:57 PM
Don't you already have a topic on this?

Anyway,

Are you sure this is the code that's causing the problem?

Vince
25/04/2012, 08:58 PM
http://wiki.sa-mp.com/wiki/Debugging

Scripter12345
25/04/2012, 09:07 PM
http://wiki.sa-mp.com/wiki/Debugging


Tried just but when i do /adminduty my server CMD box just closes straight away


Thank You


Please Help Me Please

Elysian`
25/04/2012, 09:16 PM
Are you sure this is the code that's causing the problem?
(4char)

Scripter12345
25/04/2012, 09:18 PM
(4char)


I think ..... The server shuts down if i do /adminduty


Thank You


Please Help Me Please

Scripter12345
25/04/2012, 10:12 PM
Please Help Me Please

Scripter12345
26/04/2012, 04:17 PM
Please Help Me Please

Pinguinn
26/04/2012, 04:25 PM
And what if you remove these two/three commands? Is the server still shutting down then?

Scripter12345
26/04/2012, 04:28 PM
And what if you remove these two/three commands? Is the server still shutting down then?


I have not tried


I need a good tutorial on how to save everyones stats when gmx


When i ever i do it it never saves the stats


Thank You


Please Help Me Please

Jonny5
26/04/2012, 04:30 PM
http://wiki.sa-mp.com/wiki/OnRconCommand

do it here when the command is called!
regards,

Scripter12345
26/04/2012, 07:43 PM
http://wiki.sa-mp.com/wiki/OnRconCommand

do it here when the command is called!
regards,


I dont quite understand please help me please


Thank You


Please Help Me Please