When A player spawns He's "Stuck" in that position
#1

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?
Reply
#2

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
Reply
#3

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)
Reply
#4

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.
Reply
#5

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
Reply
#6

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
Reply
#7

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

I found out it was his skin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)