[PROBLEM] SetPlayerPos
#1

For some reason my players fall through the floor when they spawn, and sometimes they don't, which annoys me ALLOT.

Here's my code:

pawn Код:
new Float:CivilianRandomSpawns[3][3] = {
{1481.0154, -1770.7731, 18.7958},
{2446.4629, 2376.1675, 12.1635},
{-1494.1964, 920.0549, 7.1875}
};
new Float:PoliceRandomSpawns[3][3] = {
{2295.2734, 2468.7920, 10.8203},
{-1620.3188, 690.2934, 7.1875},
{1550.9331, -1675.5458, 15.6261}
};

public OnPlayerSpawn(playerid)
{
           SetPlayerRandomSpawn(playerid);
           return 1;
}
function SetPlayerRandomSpawn(playerid)
{
    if(PlayerLogged[playerid] && PlayerInfo[playerid][pHouse])// Player is logged in & owns a house
    {
        SetPlayerInterior(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hIntID]);
        SetPlayerPos(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hIntX], HouseInfo[PlayerInfo[playerid][pHouse]][hIntY], HouseInfo[PlayerInfo[playerid][pHouse]][hIntZ]);
        SetPlayerVirtualWorld(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hIntWorld]);
        return 1;
    }
    if(PlayerTeam[playerid] == TEAM_POLICE)
    {
        SetPlayerInterior(playerid, 0);
        new rand = random(sizeof(PoliceRandomSpawns));
        SetPlayerPos(playerid, PoliceRandomSpawns[rand][0], PoliceRandomSpawns[rand][1], PoliceRandomSpawns[rand][2]);
    }
    if(PlayerTeam[playerid] == TEAM_CIVILIAN || PlayerTeam[playerid] == TEAM_CRIMINAL)
    {
        SetPlayerInterior(playerid, 0);
        new rand = random(sizeof(CivilianRandomSpawns));
        SetPlayerPos(playerid, CivilianRandomSpawns[rand][0], CivilianRandomSpawns[rand][1], CivilianRandomSpawns[rand][2]);
    }
    return 1;
}
Can anyone try to figure this out? I also tried SetPlayerPosFindZ() but if i use this then i can't set the player's interior/world anymore. Anyone... this is frustrating...
Reply


Messages In This Thread
[PROBLEM] SetPlayerPos - by viKKmaN - 13.02.2011, 21:25
Re: [PROBLEM] SetPlayerPos - by Mokerr - 13.02.2011, 21:37
Re: [PROBLEM] SetPlayerPos - by viKKmaN - 13.02.2011, 22:07
Re: [PROBLEM] SetPlayerPos - by Steven82 - 14.02.2011, 03:16
Re: [PROBLEM] SetPlayerPos - by Antonio [G-RP] - 14.02.2011, 04:09
Re: [PROBLEM] SetPlayerPos - by -Rebel Son- - 14.02.2011, 05:45
Re: [PROBLEM] SetPlayerPos - by bartje01 - 14.02.2011, 06:51
Re: [PROBLEM] SetPlayerPos - by viKKmaN - 14.02.2011, 08:20
Re: [PROBLEM] SetPlayerPos - by smeti - 14.02.2011, 08:34
Re: [PROBLEM] SetPlayerPos - by viKKmaN - 14.02.2011, 12:03

Forum Jump:


Users browsing this thread: 1 Guest(s)