Posts: 626
Threads: 46
Joined: Oct 2014
Reputation:
0
Hello Friends!
I want to create new spec system. When we do /spec and then when we off /specoff i want to back that place where we start using /spec without spawning at base.
Sorry my speaking English language skills is not so good..
Regards Humza,
Posts: 1,351
Threads: 35
Joined: Sep 2011
Reputation:
0
1: Make the command /spec normally, and test to see if it works.
2: Before you using PlayerSpectatingPlayer and TogglePlayerSpectating, save the previous position to a global variable allocated to the player.
3: Make the command /specoff, it would disable TogglePlayerSpectating and it would use SetPlayerPos to the old player's position using the global variables allocated to the player in step 2.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by gurmani11
pawn Код:
new Float:SpecX,Float:SpecY,Float:SpecZ; CMD:spec(playerid, params[]) { new id; new str[128]; if(sscanf(params, "u", id))return SendClientMessage(playerid, COLOR_RED, "Error: USAGE: /Spec [ID]"); if(!IsPlayerConnected(id))return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!"); GetPlayerPos(playerid,SpecX,SpecY,SpecZ); TogglePlayerSpectating(playerid, 1); PlayerSpectatePlayer(playerid, id); SetPlayerInterior(playerid, GetPlayerInterior(id)); return 1; } CMD:specoff(playerid, params[]) { TogglePlayerSpectating(playerid, 0); SetPlayerPos(playerid,SpecX,SpecY,SpecZ); return 1; }
|
You need to use per player variables, those are server wide, so if two people were spectating the first guy would be set to the second guys position
Posts: 626
Threads: 46
Joined: Oct 2014
Reputation:
0
Friends Thanks for ur support i make it
Thanks for all <3