Setplayerpos
#1

i made a checkpoint which pops up a dialog like this:

PHP код:
if(dialogid == DIALOG_ARENAS1)
    {
     if(
response)
        {
            if(
playerData[playerid][playerWantedLevel] < 3)
            {    
            
                if(
listitem == 0)
                    {
                        
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
                        
SetPlayerVirtualWorld(playerid20);
                        
playerData[playerid][IsInArena1] = true;
                        
playerData[playerid][IsInAArena] = true;
                        
GivePlayerWeaponEx(playeridWEAPON_DEAGLE6000);
                        
GivePlayerWeaponEx(playeridWEAPON_SNIPER6000);
                        
                    }
                    if(
listitem == 1)
                    {
                        
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
                        
SetPlayerVirtualWorld(playerid21);
                        
playerData[playerid][IsInArena2] = true;
                        
playerData[playerid][IsInAArena] = true;
                        
GivePlayerWeaponEx(playeridWEAPON_DEAGLE6000);
                        
GivePlayerWeaponEx(playeridWEAPON_SAWEDOFF6000);
                    }
                    if(
listitem == 2)
                    {
                        
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
                        
SetPlayerVirtualWorld(playerid22);
                        
playerData[playerid][IsInArena3] = true;
                        
playerData[playerid][IsInAArena] = true;
                        
GivePlayerWeaponEx(playeridWEAPON_SHOTGSPA6000);
                        
GivePlayerWeaponEx(playeridWEAPON_MP56000);
                    }
                    if(
listitem == 3)
                    {
                        
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
                        
SetPlayerVirtualWorld(playerid23);
                        
playerData[playerid][IsInArena4] = true;
                        
playerData[playerid][IsInAArena] = true;
                        
GivePlayerWeaponEx(playeridWEAPON_SNIPER6000);
                        
GivePlayerWeaponEx(playeridWEAPON_SAWEDOFF6000);
                    }
                    if(
listitem == 4)
                    {
                        
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
                        
SetPlayerVirtualWorld(playerid24);
                        
playerData[playerid][IsInArena5] = true;
                        
playerData[playerid][IsInAArena] = true;
                        
GivePlayerWeaponEx(playeridWEAPON_SNIPER6000);
                        
GivePlayerWeaponEx(playeridWEAPON_SHOTGSPA6000);
                    }
            }
            else
                {
                    
SendClientMessage(playeridCOLOR_RED"You cannot enter duel arena with wanted level!");
                }    
        }    
    return 
1;    

problem is players gets teleported at a strange place (above SF ship) although i took cords from samp site .




another problem is, on spawn i am using this: but still doesnt works (uses normal spawn).

PHP код:
if(playerData[playerid][IsInAArena])
    {
        if(
playerData[playerid][IsInArena1])
        {
            
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
            
SetPlayerVirtualWorld(playerid20);
        }
        else if(
playerData[playerid][IsInArena2])
        {
            
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
            
SetPlayerVirtualWorld(playerid21);
        }
        else if(
playerData[playerid][IsInArena3])
        {
            
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
            
SetPlayerVirtualWorld(playerid22);
        }
        else if(
playerData[playerid][IsInArena4])
        {
            
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
            
SetPlayerVirtualWorld(playerid23);
        }
        else if(
playerData[playerid][IsInArena5])
        {
            
SetPlayerPos(playerid, -1410.72,1591.16,1052.53);
            
SetPlayerVirtualWorld(playerid24);
        }
        
SendClientMessage(playerid, -1"You spawned in a duel arena! use /leavearena to leave the duel arena!");
    } 


any solutions?
Reply
#2

bump?
Reply
#3

For the first case, Maybe the coords are set to an interior (use SetPlayerInterior) because most of the time SA-MP wiki (maybe that is the site you are referring to?) is reliable (at least for me) when it comes to coords locations.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)