Crash on /acover?
#1

Problem: When i type /acover,my server is crashing,why?

Commands:

Код:
CMD:acover(playerid, params[], help)
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi inainte de a face asta.");
    if(PlayerInfo[playerid][pAdmin] > 5)
    {
	    new name[25], level;
	    if(sscanf(params, "s[25]i", name, level)) return SCM(playerid, COLOR_WHITE, "/acover [Nume] [Nivel]");
	    SetPlayerName(playerid, name);
	    SetPlayerSkin(playerid, random(299));
	    SetPlayerScore(playerid, level);
	    SetPlayerColor(playerid,COLOR_WHITE);
	    if(acovered[playerid] != 1)
	    {
	    	SendClientMessage(playerid, COLOR_DARKPINK, "Ai activat modul 'acover'!");
	    }
	    else
	    {
	    	SendClientMessage(playerid, COLOR_DARKPINK, "Ai schimbat setarile 'acover'!");
	    }
	    acovered[playerid] = 1;
	}
    else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    return 1;
}

CMD:acoveroff(playerid, params[], help)
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi inainte de a face asta.");
    if(PlayerInfo[playerid][pAdmin] > 5)
    {
    	if(acovered[playerid] == 1)
    	{
    		acovered[playerid] = 0;
    		SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
		    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
		    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
		    SendClientMessage(playerid, COLOR_DARKPINK, "Ai dezactivat modul 'acover'!");
    	}
		else return SendClientMessage(playerid, COLOR_WHITE, "Nu ai acover activat!");
	}
    else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    return 1;
}

CMD:scoateacover(playerid, params[], help)
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi inainte de a face asta.");
    if(PlayerInfo[playerid][pAdmin] > 5)
    {
    	new id;
    	if(sscanf(params, "u", id)) return SCM(playerid, COLOR_WHITE, "/acover [Nume/ID]");
    	if(acovered[id] == 1)
    	{
    		if(EstiFondator(id)) return SendClientMessage(id, COLOR_DARKPINK, "Nu-i poti dezactiva modul 'acover' fondatorului!");
    		if(id == playerid) return SendClientMessage(id, COLOR_DARKPINK, "Foloseste /acoveroff!");
    		if(gPlayerLogged[id] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Acest jucator nu este logat.");
    		acovered[id] = 0;
    		SetPlayerName(id, PlayerInfo[playerid][pNormalName]);
		    SetPlayerScore(id, PlayerInfo[playerid][pLevel]);
		    SetPlayerSkin(id, PlayerInfo[playerid][pModel]);
		    SendClientMessage(id, COLOR_DARKPINK, "Ai dezactivat modul 'acover'!");
    	}
		else return SendClientMessage(playerid, COLOR_WHITE, "Acest jucator nu are acover activat!");
	}
    else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    return 1;
}
Reply
#2

check if the plugins are loaded correctly, especially sscanf.
Reply
#3

Quote:
Originally Posted by Mugala
Посмотреть сообщение
check if the plugins are loaded correctly, especially sscanf.
Scanf works fine.
Reply
#4

If server is crashing you should also provide us the server log. Also, are you using crashdetect? If not, download it, load it and make server crash, then read logs.
Reply
#5

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
If server is crashing you should also provide us the server log. Also, are you using crashdetect? If not, download it, load it and make server crash, then read logs.
Ok. wait.
Reply
#6

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
If server is crashing you should also provide us the server log. Also, are you using crashdetect? If not, download it, load it and make server crash, then read logs.
Nothing in log.
Reply
#7

https://sampwiki.blast.hk/wiki/SetPlayerName

Passing a null string as the new name will crash the server.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)