SA-MP Forums Archive
Crash on /acover? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Crash on /acover? (/showthread.php?tid=664544)



Crash on /acover? - Longover - 03.03.2019

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;
}



Re: Crash on /acover? - Mugala - 03.03.2019

check if the plugins are loaded correctly, especially sscanf.


Re: Crash on /acover? - Longover - 03.03.2019

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


Re: Crash on /acover? - v1k1nG - 03.03.2019

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.


Re: Crash on /acover? - Longover - 03.03.2019

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.


Re: Crash on /acover? - Longover - 03.03.2019

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.


Re: Crash on /acover? - v1k1nG - 03.03.2019

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

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