Spec help!
#1

Okay guys, I need a filterscript for a spec command.
Basicly I want:
1. /spec [id/part of name] ( will detect weather it's a walking spec or vehicle )
2. /endspec ( will obviously end the spec and return player to the position that they typed '/spec ***'.

I have found and tried shit loads of filterscripts that will spec fine, But on /endspec it respawns randomly. I would like it to respawn to the position where they started the spec...

Please help.

Anything helpful would be amazing.
Reply
#2

Use " GetPlayerPos(playerid, x, y, z); "
Post your codes,and il fix it for you.
Reply
#3

http://pastebin.com/dWhVrSMF

Would you be able to port it back as a .pwn or something?

Thanks alot man!

I'll put you in credits. :3
Reply
#4

PHP код:
//------------------------------------------------------------------------------
 
stock StartSpectate(playeridspecplayerid)
{      
         
        
//Save the players location so we can spawn him there again on stopspec
        
new LastPos
        
new Float:xFloat:yFloat:z;
        
LastPos GetPlayerPos(playeridxyz);
        
        for(new 
x=0x<MAX_PLAYERSx++)
        {
            if(
GetPlayerState(x) == PLAYER_STATE_SPECTATING && Spec[x][SpectateID] == playerid)
                {
               
AdvanceSpectate(x);
                }
        }
        
TogglePlayerSpectating(playerid1);
        
Spec[playerid][SpectateUpdate] = specplayerid;
        
SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
        
SetPlayerVirtualWorld(playeridGetPlayerVirtualWorld(specplayerid));
        if(
IsPlayerInAnyVehicle(specplayerid))
        {
                
PlayerSpectateVehicle(playeridGetPlayerVehicleID(specplayerid));
                
Spec[playerid][SpectateID] = specplayerid;
                
Spec[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
        }
        else
        {
                
PlayerSpectatePlayer(playeridspecplayerid);
                
Spec[playerid][SpectateID] = specplayerid;
                
Spec[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
        }
        return 
1;
}
 
stock StopSpectate(playerid)
{
        
SetPlayerPos(playeridLastPos);
       
TogglePlayerSpectating(playerid0);
        
Spec[playerid][SpectateID] = INVALID_PLAYER_ID;
        
Spec[playerid][SpectateType] = ADMIN_SPEC_TYPE_NONE;
        
Spec[playerid][SpectateUpdate] = 255;
        
GameTextForPlayer(playerid,"~n~~n~~n~~w~Spectate mode ended",1000,3);
        return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)