Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock UnstickPlayer(playerid)
- {
- new Float:x, Float:y, Float:z,
- Float:otherx, Float:othery, Float:otherz;
- GetPlayerPos(playerid, x, y, z); //Get possibly stuck player's position
- foreach(new i : Player) //Loop through all connected players and...
- {
- if(i != playerid) //... if they aren't the stuck player...
- {
- GetPlayerPos(playerid, otherx, othery, otherz); //... get their position
- if(IsPlayerInRangeOfPoint(playerid, 0.1, otherx, othery, otherz)) //and if the stuck player is within a range of 0.1 to any other players
- {
- SetPlayerPos(playerid, x, y+0.5, z); // move them slightly
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment