SA-MP Forums Archive
Bug respawn - 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: Bug respawn (/showthread.php?tid=597255)



Bug respawn - Sn4ke2 - 28.12.2015

Hello Who Knows This Bug ?

If I am in Car than don't respawn me in right position

Wich is in this video:


[ame]http://www.youtube.com/watch?v=BawJDRZiYLc[/ame]

Here is CMD:

PHP код:
CMD:respawn(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SCM(playeridCOLOR_LIGHTRED"login!");
    if(
IsPlayerConnected(playerid))
    {
          if (
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pHelper] >= 1)
        {
            new 
id,sendername[30],giveplayer[30],string[100];
            if(
sscanf(params"u"id)) return SCM(playerid,COLOR_WHITE,"type: /respawn <Name/Playerid>");
            {
                if(
IsPlayerConnected(id))
                {
                    if(
id != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(idgiveplayersizeof(giveplayer));
                        
SpawnPlayer(id);
                        
GetPlayerName(playeridsendernamesizeof(sendername));
         
                        return 
1;
                    }
                }
                else
                {
                    
SCM(playerid,COLOR_WHITE,"The player is not connected.");
                }
            }
           }
        else
        {
            
SCM(playeridCOLOR_WHITEAdminOnly);
        }
    }
    return 
1;




Re: Bug respawn - Jefff - 28.12.2015

If you spawn player in vehicle there is a cigarette bug, use
pawn Код:
new Float:x, Float:y, Float:z;
// RemovePlayerFromVehicle(id); // uncomment if doesnt work
GetPlayerPos(id, x, y, z);
SetPlayerPos(id, x, y, z);
SpawnPlayer(id);



Re: Bug respawn - Sn4ke2 - 28.12.2015

And this inside cmd ?


Re: Bug respawn - Jefff - 28.12.2015

Yes change "SpawnPlayer(id);" to my code


Re: Bug respawn - Sn4ke2 - 28.12.2015

ok, thanks :*


Re: Bug respawn - Sn4ke2 - 29.12.2015

@Jefff Thanks i give you + REP