SA-MP Forums Archive
When A player spawns He's "Stuck" in that position - 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: When A player spawns He's "Stuck" in that position (/showthread.php?tid=366521)



When A player spawns He's "Stuck" in that position - Eminem 2ka9 - 06.08.2012

When my friend spawns he is stuck where he spawns and can't move, he can jump and run but it gets him no where.
The only code I have in OnPlayerSpawn Is:

Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid,26,500);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,24,500);
    GivePlayerWeapon(playerid,34,500);
    GivePlayerWeapon(playerid,30,500);
    
}
Also my Sawn-Off glitches like I can't scroll to it because it instantly goes back to the previous weapon. I think I have 2 Registration systems could that cause this?


Re: When A player spawns He's "Stuck" in that position - Ranama - 06.08.2012

yes, I had this thing in my gamemode to but I don't remember how i fixed it, try looking for SpawnPlayer functions and see if there are more then one etc


Re: When A player spawns He's "Stuck" in that position - XStormiest - 06.08.2012

a singe function that make this posible is TogglePlayerControllable(playerid,false/true);
pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid,26,500);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,24,500);
    GivePlayerWeapon(playerid,34,500);
    GivePlayerWeapon(playerid,30,500);
    TogglePlayerControllable(playerid,false);
   SetTimer("Move",6*1000,0);
}

forward Move();
public Move()
{
       for(new i; i == MAX_PLAYERS;++i)
          {
                   TogglePlayerControllable(i,true);
           }
}
this will block it for 6 seconds so if he can't move he wil can again 6 seconds because TogglePlayerControllable will set to true ( can move and more)


Re: When A player spawns He's "Stuck" in that position - kbalor - 06.08.2012

Please show some coordinates.

EDIT: Sample Below

X Y Z
I mean this (-1560.9484,-142.3489,15.465

If ever this is your problem just add 2 in 15.4658 so its now 17.4658. This will add the height of the spawn.

Sometimes the streamer loads too long that's why when you spawn you get stuck.


Re: When A player spawns He's "Stuck" in that position - Ranama - 06.08.2012

Quote:
Originally Posted by XStormiest
Посмотреть сообщение
a singe function that make this posible is TogglePlayerControllable(playerid,false/true);
pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid,26,500);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,24,500);
    GivePlayerWeapon(playerid,34,500);
    GivePlayerWeapon(playerid,30,500);
    TogglePlayerControllable(playerid,false);
   SetTimer("Move",6*1000,0);
}

forward Move();
public Move()
{
       for(new i; i == MAX_PLAYERS;++i)
          {
                   TogglePlayerControllable(i,true);
           }
}
this will block it for 6 seconds so if he can't move he wil can again 6 seconds because TogglePlayerControllable will set to true ( can move and more)
No it's not that problem, it's like a loop that always set a players pos/respawn the player


Re: When A player spawns He's "Stuck" in that position - Eminem 2ka9 - 06.08.2012

These are what my server uses to spawn
Код:
217,-1342.1843,501.3151,18.2344,3.7669,0,0,0,0,0,0
The server doesn't use raw positions, where would I put 15.465 here? And yes When I slap him hes fine so hes feet were in the ground


Re: When A player spawns He's "Stuck" in that position - Vince - 06.08.2012

Just increase Z-position by 2, as someone said. Fourth parameter in your code.


Re: When A player spawns He's "Stuck" in that position - Eminem 2ka9 - 06.08.2012

I found out it was his skin