SA-MP Forums Archive
Work /spec on 0.3x? - 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: Work /spec on 0.3x? (/showthread.php?tid=435340)



Work /spec on 0.3x? - Blackazur - 06.05.2013

Hello, i would ask if /spec work on 0.3x cause i tried every Methods but the Admin die when he use /spec, and i dont know why. So work /spec on 0.3x?


Re: Work /spec on 0.3x? - NathNathii - 06.05.2013

Yes it does.


Re: Work /spec on 0.3x? - dannyk0ed - 06.05.2013

Maybe your coding is incorrect, please show us..


Re: Work /spec on 0.3x? - Excel™ - 06.05.2013

Theres no command like /Spec as default in samp folder. You need a Spectate script which you must confirm that its compiled correctly, added in Gamemode / Filterscript section and Running after launching server.cfg.

Or just show your code please.. ^^


AW: Work /spec on 0.3x? - Blackazur - 06.05.2013

Код:
COMMAND:spec(playerid,params[])
{
        if(pInfo[playerid][pAdminLevel] >= 1)
    {
	new id;
	if(sscanf(params,"d",id)) return SendClientMessage(playerid,-1,""chat""COL_YELLOW" Usage: /sped <id>");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,""chat""COL_RED" Player is not connected!");

	TogglePlayerSpectating(playerid,1);
    PlayerSpectatePlayer(playerid,id);
    SetPlayerInterior(playerid,GetPlayerInterior(id));
 	}
	else {
		SendClientMessage(playerid,-1,""chat""COL_RED" You do not have the right admin permissions for this command!");
	}
	return 1;
}

COMMAND:specoff(playerid,params[])
{
        if(pInfo[playerid][pAdminLevel] >= 1)
    {

      TogglePlayerSpectating(playerid,0);
    	}
	else {
		SendClientMessage(playerid,-1,""chat""COL_RED" You do not have the right admin permissions for this command!");
	}
	return 1;
}
It working only on 1 Gamemode i've created in the others i have always this bug that the admin dieng when he use the command.


AW: Work /spec on 0.3x? - Blackazur - 06.05.2013

Hello? someone?


Re: Work /spec on 0.3x? - MattyG - 06.05.2013

Change your sscanf specifier from "d" to "u". This is because u is used for players, d and i are for general integers