[COMMAND] /spec
#4

Quote:
Originally Posted by BarFix
Посмотреть сообщение
Thats what this is xD

Код:
    GetPlayerPos(playerid, x, y, z);
		TogglePlayerSpectating(playerid, true);
		PlayerSpectatePlayer(playerid, giveplayerid);
		SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
		SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
		spec[playerid] = giveplayerid;
Well, x, y and z are local variables which don't exist outside of the command.
Код:
CMD:spec(playerid, params[])
{
	new giveplayerid, Float:x, Float:y, Float:z;
Create some global variables at the top of your script:
Код:
new Float:specPos[MAX_PLAYERS][3], specInt[MAX_PLAYERS], specVW[MAX_PLAYERS];

//Old position, int and vw of the admin.
GetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
specInt[playerid] = GetPlayerInterior(playerid);
specVW[playerid] = GetPlayerVirtualWorld(playerid);
Reply


Messages In This Thread
[COMMAND] /spec - by BarFix - 31.10.2015, 17:36
Re: [COMMAND] /spec - by MartinSwag - 31.10.2015, 17:55
Re: [COMMAND] /spec - by BarFix - 31.10.2015, 17:58
Re: [COMMAND] /spec - by MartinSwag - 31.10.2015, 18:26

Forum Jump:


Users browsing this thread: 1 Guest(s)