Teleport back after SetPlayerPos
#1

Heloo i got a question how can i teleport back to old pos after SetPlayerPos? if there is plugin or something fell free to post it.
Reply
#2

Save the player's position with GetPlayerPos using global variables.

On top:
pawn Код:
new
    g_pPos[ MAX_PLAYERS ][ 3 ] //First dimension to hold for each player, second dimension for X Y Z
;
Where ever you set the player's position:
pawn Код:
GetPlayerPos( playerid, g_pPos[ playerid ][ 0 ], g_pPos[ playerid ][ 1 ], g_pPos[ playerid ][ 2 ] );
You may now use
pawn Код:
SetPlayerPos( playerid, g_pPos[ playerid ][ 0 ], g_pPos[ playerid ][ 1 ], g_pPos[ playerid ][ 2 ] + 0.5 );
to get the player back to where he came from.
Reply
#3

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Save the player's position with GetPlayerPos using global variables.

On top:
pawn Код:
new
    g_pPos[ MAX_PLAYERS ][ 3 ] //First dimension to hold for each player, second dimension for X Y Z
;
Where ever you set the player's position:
pawn Код:
GetPlayerPos( playerid, g_pPos[ playerid ][ 0 ], g_pPos[ playerid ][ 1 ], g_pPos[ playerid ][ 2 ] );
You may now use
pawn Код:
SetPlayerPos( playerid, g_pPos[ playerid ][ 0 ], g_pPos[ playerid ][ 1 ], g_pPos[ playerid ][ 2 ] + 0.5 );
to get the player back to where he came from.

Uhm i dont really understand but coud you explain how i put something like savind the position on /enter and spawning to that same position when you /exit

lines
PHP код:
    if(strcmp(cmd"/enter"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            for(new 
0sizeof(HouseInfo); i++)
            {
                if (
IsPlayerInRangeOfPoint(playerid10,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
                {
                    
//printf("Found House :%d",i);
                    
if(PlayerInfo[playerid][pPhousekey] == || HouseInfo[i][hLock] == 0)
                    {
                        if(
PlayerInfo[playerid][pWanted] == 0)
                        {
                            
SafeSetPlayerInterior(playerid,HouseInfo[i][hInt]);
                            
SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
                            
SafeSetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
                            
GameTextForPlayer(playerid"~w~Welcome Home"50001);
                            
PlayerInfo[playerid][pLocal] = i;
                            
PlayerInfo[playerid][pVirWorld] = HouseInfo[i][hWorld];
                            
HouseEntered[playerid] = i;
                            
PlayerInfo[playerid][pInteriorNr] = 39;
                        }
                        else
                        {
                            
GameTextForPlayer(playerid"~r~Criminals can't hide in houses!"50001);
                            return 
1;
                        }
                    }
                    else
                    {
                        
GameTextForPlayer(playerid"~r~Locked"50001);
                        return 
1;
                    }
                }
            }
            for(new 
0sizeof(BizzInfo); i++)
            {
                if (
IsPlayerInRangeOfPoint(playerid5,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
                {
                    if(
PlayerInfo[playerid][pPbiskey] == || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
                    {
                        if(
PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(
BizzInfo[i][bLocked] == 1)
                            {
                                
GameTextForPlayer(playerid"~r~Closed"50001);
                                return 
1;
                            }
                            if(
BizzInfo[i][bProducts] == 0)
                            {
                                
GameTextForPlayer(playerid"~r~Out Of Stock"50001);
                                return 
1;
                            }
                            
SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
                            
format(stringsizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out"BizzInfo[i][bEntranceCost]);
                            
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
                            
ExtortionBiz(iBizzInfo[i][bEntranceCost]);
                            
BizzInfo[i][bProducts]--;
                            
OnPropUpdate(2,i);
                            
GameTextForPlayer(playeridstring50003);
                        }
                        
PlayerInfo[playerid][pInteriorNr] = BizzInfo[i][bInteriorNr];
                        
SetPlayerVirtualWorld(playerid,BizzInfo[i][bVirWorld]);
                        
SafeSetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                        
SafeSetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                        new 
dood[MAX_PLAYER_NAME];
                        
GetPlayerName(playeriddoodsizeof(dood));
                        
BizzEntered[playerid] = i;
                        new 
h,mi,s,y,m,d;
                        
getdate(y,m,d);
                        
gettime(h,mi,s);
                        
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s payed $%d to enter biz %d",d,m,y,h,mi,sdoodBizzInfo[i][bEntranceCost], i);
                        
printf("%s"string);
                        
PayLog(string);
                        if(
BizzInfo[i][bVirWorld] == || BizzInfo[i][bVirWorld] == 1)
                        {
                            
OnPlayerEnterFood(playerid1);
                        }
                        else if(
BizzInfo[i][bVirWorld] == || BizzInfo[i][bVirWorld] == 3)
                        {
                            
OnPlayerEnterFood(playerid2);
                        }
                        else if(
BizzInfo[i][bVirWorld] == || BizzInfo[i][bVirWorld] == 5)
                        {
                            
OnPlayerEnterFood(playerid3);
                        }
                        else if(
BizzInfo[i][bVirWorld] == 6)
                        {
                            
OnPlayerEnterFood(playerid4);
                        }
                    }
                    else
                    {
                        
GameTextForPlayer(playerid"~r~You dont have the cash"50001);
                    }
                }
            }
            for(new 
0sizeof(SBizzInfo); i++)
            {
                if (
IsPlayerInRangeOfPoint(playerid3,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
                {
                    if(
PlayerInfo[playerid][pPbiskey] == || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
                    {
                        if(
PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(
SBizzInfo[i][sbLocked] == 1)
                            {
                                
GameTextForPlayer(playerid"~r~Closed"50001);
                                return 
1;
                            }
                            if(
SBizzInfo[i][sbProducts] == 0)
                            {
                                
GameTextForPlayer(playerid"~r~Out Of Stock"50001);
                                return 
1;
                            }
                            
SafeGivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
                            
gSpentCash[playerid] = GetPlayerMoney(playerid);
                            
SBizzInfo[i][sbProducts]--;
                            
SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
                            
ExtortionSBiz(iSBizzInfo[i][sbEntranceCost]);
                            new 
dood[MAX_PLAYER_NAME];
                            
GetPlayerName(playeriddoodsizeof(dood));
                            
format(stringsizeof(string), "%s payed $%d to enter sbiz %d"doodSBizzInfo[i][sbEntranceCost], i);
                            
printf("%s"string);
                            
PayLog(string);
                            
OnPropUpdate(3,i);
                        }
                    }
                    else
                    {
                        
GameTextForPlayer(playerid"~r~You dont have the cash"50001);
                    }
                }
            }
            if (
IsPlayerInRangeOfPoint(playerid3,2695.6235,-1704.6960,11.8438))
            {
                
GameTextForPlayer(playerid"~w~Welcome to the 8ball Track"50001);
                
SafeSetPlayerInterior(playerid,7);
                
SafeSetPlayerPos(playerid,-1404.5299,-259.0602,1043.6563);
            }
            else if (
IsPlayerInRangeOfPoint(playerid8,-2111.5686,-443.9720,38.7344))
            {
                
GameTextForPlayer(playerid"~w~Welcome to the Dirt Track"50001);
                
SafeSetPlayerInterior(playerid,4);
                
SafeSetPlayerPos(playerid,-1443.0554,-581.1879,1055.0472);
            }
            else if (
IsPlayerInRangeOfPoint(playerid3,-2080.3079,-406.0309,38.7344))
            {
                
GameTextForPlayer(playerid"~w~Welcome to the Stunting Track"50001);
                
SafeSetPlayerInterior(playerid,14);
                
SafeSetPlayerPos(playerid,-1464.7732,1557.5533,1052.5313);
            }
            if (
IsPlayerInRangeOfPoint(playerid,10,1099.3762,1601.5387,12.5469))
            {
                if (
GetPlayerState(playerid) == 2)
                {
                       if (
PlayerInfo[playerid][pDTK] == && PlayerInfo[playerid][pDM] == && PlayerInfo[playerid][pAdmin] <= 2)
                    {
                        
SendClientMessage(playerid,COLOR_NICERED,"You do not have a DD Ticket!");
                        
format(stringsizeof(string), "[ADMIN]: %s Tried to Enter to the DDS Without a Ticket!"sendername);
                        
ABroadCast(COLOR_LIGHTRED,string5);
                        return 
1;
                    }
                    new 
tmpcar GetPlayerVehicleID(playerid);
                    new 
vehicleid GetPlayerVehicleID(playerid);
                    
SetVehiclePos(tmpcar, -1437.1271,990.9039,1030.5000);
                    
PlayerInfo[playerid][pDTK] = 0;
                    
SafeSetPlayerInterior(playerid15)
                    
LinkVehicleToInterior(vehicleid15);
                    
PlayerInfo[playerid][pInteriorNr] = 25;
                    
GameTextForPlayer(playerid,"~p~Raven's Roleplay ~n~~r~Destruction Derby Stadium"5000,1)
                    
SendClientMessage(playeridCOLOR_NICERED"Welcome to the Raven's Roleplay Destruction Derby Stadium (DD)");
                    
SendClientMessage(playeridTEAM_VAGOS_COLOR"----------------------------------DD Main Rules---------------------------------------");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Ram Someone Before the Admin Does a countdown is equal to two hours Jail");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"The Center Square means Hosters Area");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"If you do not host the DD, You are not Allowed to Get to the Hoster Area");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Getting into the Hoster Area without beginning a Hoster is equal to 30 Minutes Jail");
                    
SendClientMessage(playeridTEAM_VAGOS_COLOR"----------------------------------Driver Rules----------------------------------------");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Get to the Corners of the Stadium and Wait for The Admin Voice!");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"The Last One That remains without getting destroyed Wins");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Prize: 13,337 ML$ And 1500 Bullets Of Any Gun; GOOD LUCK!");
                }
                else
                {
                    if (
PlayerInfo[playerid][pDSTK] == && PlayerInfo[playerid][pDM] == && PlayerInfo[playerid][pAdmin] <= 2)
                    {
                        
SendClientMessage(playerid,COLOR_NICERED,"You do not have a DD (S) Ticket!");
                        
format(stringsizeof(string), "[ADMIN]: %s Tried to Enter to the DD (S) Without a Ticket!"sendername);
                        
ABroadCast(COLOR_LIGHTRED,string5);
                        return 
1;
                    }
                    
GameTextForPlayer(playerid"~p~Raven's Roleplay ~n~~r~~h~Destruction Derby Stadium ~n~~g~Las Venturas"50001);
                    
SafeSetPlayerInterior(playerid15);
                    
SafeSetPlayerPos(playerid,-1390.0785,930.2457,1041.5313);
                    
PlayerInfo[playerid][pDSTK] = 0;
                    
PlayerInfo[playerid][pInteriorNr] = 25;
                    
SendClientMessage(playeridCOLOR_NICERED"Welcome to the Raven's Roleplay Destruction Derby Stadium (DD)");
                    
SendClientMessage(playeridTEAM_VAGOS_COLOR"------------------------------------DD Main Rules------------------------------------");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Ram Someone Before the Manager Does a countdown is equal to two hours Jail");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"The Center Square means Hosters Area");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"If you do not host the DD, You are not Allowed to Get to the Hoster Area");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Getting into the Hoster Area without beginning a Hoster is equal to 30 Minutes Jail");
                    
SendClientMessage(playeridTEAM_VAGOS_COLOR"----------------------------------Spectator Rules------------------------------------");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Remain at the Spectators Area And Have Fun!");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Do not Attack ANYONE At the Spectators Area");
                    
SendClientMessage(playeridTEAM_GROVE_COLOR"Attacking Someone or Entering inside of the stadium is equal 30 Minutes Jail.");
                }
            }
            else if (
IsPlayerInRangeOfPoint(playerid4,2073.2979,-1831.1228,13.5469))
            { 
// Pay & Spray
                
if(GetPlayerState(playerid) == 2)
                {
                    if(
GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
                    {
                        if(
SBizzInfo[5][sbProducts] > 0)
                        {
                               new 
tmpcar GetPlayerVehicleID(playerid);
                            
SetVehiclePos(tmpcar2062.1294,-1831.5498,13.5469);
                            
SetVehicleZAngle(tmpcar90);
                            
SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
                            
SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
                            
SBizzInfo[5][sbProducts]--;
                            
SetTimerEx("AfterSpray1"7500false"i"playerid);
                        }
                        else
                        {
                            
GameTextForPlayer(playerid"~r~Out of stock"50001);
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"You don't have enough money to enter Pay & Spray.");
                    }
                }
            }
            else if (
IsPlayerInRangeOfPoint(playerid4,1024.9756,-1030.7930,32.0257))
            { 
// Pay & Spray
                
if(GetPlayerState(playerid) == 2)
                {
                    if(
GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
                    {
                        if(
SBizzInfo[5][sbProducts] > 0)
                        {
                               new 
tmpcar GetPlayerVehicleID(playerid);
                            
SetVehiclePos(tmpcar1024.9763,-1021.8850,32.1016);
                            
SetVehicleZAngle(tmpcar0);
                            
SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
                            
SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
                            
SBizzInfo[5][sbProducts]--;
                            
SetTimerEx("AfterSpray2"7500false"i"playerid);
                        }
                        else
                        {
                            
GameTextForPlayer(playerid"~r~Out of stock"50001);
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"You don't have enough money to enter Pay & Spray.");
                    }
                }
            }
            else if (
IsPlayerInRangeOfPoint(playerid4,488.3819,-1733.0563,11.1752))
            { 
// Pay & Spray
                
if(GetPlayerState(playerid) == 2)
                {
                    if(
GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
                    {
                        if(
SBizzInfo[5][sbProducts] > 0)
                        {
                               new 
tmpcar GetPlayerVehicleID(playerid);
                            
SetVehiclePos(tmpcar487.4099,-1741.4585,11.1330);
                            
SetVehicleZAngle(tmpcar180);
                            
SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
                            
SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
                            
SBizzInfo[5][sbProducts]--;
                            
SetTimerEx("AfterSpray3"7500false"i"playerid);
                        }
                        else
                        {
                            
GameTextForPlayer(playerid"~r~Out of stock"50001);
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"You don't have enough money to enter Pay & Spray.");
                    }
                }
            }
            else if (
IsPlayerInRangeOfPoint(playerid4,719.8940,-464.8272,16.3359))
            { 
// Pay & Spray
                
if(GetPlayerState(playerid) == 2)
                {
                    if(
GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
                    {
                        if(
SBizzInfo[5][sbProducts] > 0)
                        {
                               new 
tmpcar GetPlayerVehicleID(playerid);
                            
SetVehiclePos(tmpcar720.3924,-456.0286,16.3359);
                            
SetVehicleZAngle(tmpcar0);
                            
SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
                            
SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
                            
SBizzInfo[5][sbProducts]--;
                            
SetTimerEx("AfterSpray4"7500false"i"playerid);
                        }
                        else
                        {
                            
GameTextForPlayer(playerid"~r~Out of stock"50001);
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"You don't have enough money to enter Pay & Spray.");
                    }
                }
            }
        }
        new 
ymd;
        new 
h,mi,s;
        
getdate(y,m,d);
        
gettime(h,mi,s);
        
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /enter",d,m,y,h,mi,s,sendername);
        
CommandLog(string);
        return 
1;
    }
    if(
strcmp(cmd"/exit"true) == 0)
    {
        
OnPlayerUpdateEx(playerid);
        if(
PlayerInfo[playerid][pMaskuse] == 1)
        {
            for(new 
0MAX_PLAYERSi++)
               {
                   if(
IsPlayerConnected(i))
                   {
                       
ShowPlayerNameTagForPlayer(iplayerid0);
                }
            }
        }
        if(
IsPlayerConnected(playerid))
        {
            if(
HouseEntered[playerid] != 9999)
            {
                new 
HouseEntered[playerid];
                if (
IsPlayerInRangeOfPoint(playerid3,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
                {
                    
SafeSetPlayerInterior(playerid,0);
                    
SafeSetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
                    
SetPlayerVirtualWorld(playerid,0);
                    
PlayerInfo[playerid][pVirWorld] = 0;
                    
HouseEntered[playerid] = 9999;
                    if(
HouseInfo[i][hHel] == 1)
                    {
                        new 
Float:tempheal;
                        
GetPlayerHealth(playerid,tempheal);
                        if(
tempheal 100.0)
                        {
                            
SetPlayerHealth(playerid,100.0);
                        }
                    }
                    return 
1;
                }
            }
            if(
BizzEntered[playerid] != 9999)
            {
                new 
BizzEntered[playerid];
                if (
IsPlayerInRangeOfPoint(playerid3,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
                {
                    
SafeSetPlayerInterior(playerid,0);
                    
SetPlayerVirtualWorld(playerid0);
                    
OnPlayerExitFood(playerid);
                    
SafeSetPlayerPos(playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
                    
SetPlayerVirtualWorld(playerid0);
                    
BizzEntered[playerid] = 9999;
                }
            }
            new 
carid GetPlayerVehicleID(playerid);
            if (
IsABus(carid))
            {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
                if (
BusrouteEast[playerid][0] != || BusrouteWest[playerid][0] != 0BusrouteEnd(playeridcarid);
            }
            if (
IsASweeper(carid))
            {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
            }
            if(
IsAHarvest(carid))
            {
                if (
carid != 0)
                {
                    
SetVehicleToRespawn(carid);
                }
                if(
FarmerPickup[playerid][0] >= && FarmerPickup[playerid][0] <= 22)
                {
                    
FarmerPickup[playerid][0]--;
                }
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
                
FarmerVar[playerid] = 0;
                
DisablePlayerCheckpoint(playerid);
            }
            if(
IsADrugHarvest(carid))
            {
                if(
DrugFarmerPickup[playerid][0] >= && DrugFarmerPickup[playerid][0] <= 37)
                {
                    
DrugFarmerPickup[playerid][0]--;
                }
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
                
DrugFarmerVar[playerid] = 0;
                
DisablePlayerCheckpoint(playerid);
            }
            if(
IsASmuggleCar(carid))
            {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
                
SmugglerWork[playerid] = 0;
                
DisablePlayerCheckpoint(playerid);
            }
            if(
Decoding[playerid] == 1)
            {
                
Decoding[playerid] = 0;
                
SafeRemovePlayerFromVehicle(playerid);
                
KillTimer(DecoderTimer);
                
HideDecoder(playerid);
                
SendClientMessage(playeridCOLOR_NICERED"You left the car, decoder stopped!");
                
decodecode 0;
                
Decoder 0;
            }
            if(
IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0)
               {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
            }
            if(
IsPlayerInAnyVehicle(playerid) && !engineOn[GetPlayerVehicleID(playerid)] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
            }
            if(
GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130 || GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154)
            {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
            }
            else if (
IsPlayerInRangeOfPoint(playerid3,387.7978,173.8582,1008.3828))
            {
                
SafeSetPlayerInterior(playerid,0);
                
SafeSetPlayerPos(playerid,1481.0206,-1771.1138,18.7958);
                
PlayerInfo[playerid][pLocal] = 255;
            }
            else if (
IsPlayerInRangeOfPoint(playerid6,-1404.5299,-259.0602,1043.6563))
            {
                
SafeSetPlayerInterior(playerid,0);
                
SafeSetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
            }
            else if (
IsPlayerInRangeOfPoint(playerid8,-1443.0554,-581.1879,1055.0472))
            {
                
SafeSetPlayerInterior(playerid,0);
                
SafeSetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
            }
            else if (
IsPlayerInRangeOfPoint(playerid8,-1464.7732,1557.5533,1052.5313))
            {
                
SafeSetPlayerInterior(playerid,0);
                
SafeSetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
            }
            else if(
NoFuel[playerid] == 1)
            {
                
TogglePlayerControllable(playerid1);
                
SafeRemovePlayerFromVehicle(playerid);
                
NoFuel[playerid] = 0;
            }
            else if(
IsPlayerInRangeOfPoint(playerid101817.97,-1536.64,13.45))
            {
//Jail Exit By Robin_Hellman
                
if(PlayerInfo[playerid][pDuty] >= || PlayerInfo[playerid][pAdmin] >= 1)
                {
                   if(
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
                   {
                     new 
vid GetPlayerVehicleID(playerid);
                     
SetVehiclePos(vid,1817.97,-1536.64,13.45);
                     
LinkVehicleToInterior(vid,0);
                     
PutPlayerInVehicle(playerid,vid,0);
                   }
                   else
                   {
                     
GameTextForPlayer(playerid"~w~Los Santos"50001);
                     
SafeSetPlayerInterior(playerid0);
                     
SafeSetPlayerPos(playerid,1826.36,-1537.21,13.64);
                    }
                }
                else return 
SendClientMessage(playeridCOLOR_GREY,"* You are not a Guard/Police!")
            }
        }
        new 
ymd;
        new 
h,mi,s;
        
getdate(y,m,d);
        
gettime(h,mi,s);
        
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /exit",d,m,y,h,mi,s,sendername);
        
CommandLog(string);
        return 
1;
    } 
It's kinda bugged somehow before it worked fine please help me.
Reply
#4

Bump
Reply
#5

i got 3 warnings at this code:

PHP код:
            for(new 0sizeof(BizzInfo); i++)
            {
                if (
IsPlayerInRangeOfPoint(playerid5,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
                {
                    if(
PlayerInfo[playerid][pPbiskey] == || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
                    {
                        if(
PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(
BizzInfo[i][bLocked] == 1)
                            {
                                
GameTextForPlayer(playerid"~r~Closed"50001);
                                return 
1;
                            }
                            if(
BizzInfo[i][bProducts] == 0)
                            {
                                
GameTextForPlayer(playerid"~r~Out Of Stock"50001);
                                return 
1;
                            }
                            
SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
                            
format(stringsizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out"BizzInfo[i][bEntranceCost]);
                            
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
                            
ExtortionBiz(iBizzInfo[i][bEntranceCost]);
                            
BizzInfo[i][bProducts]--;
                            
OnPropUpdate(2,i);
                            
GameTextForPlayer(playeridstring50003);
                        }
                        
GetPlayerPosplayeridg_pPosplayerid ][ ], g_pPosplayerid ][ ], g_pPosplayerid ][ ] );
                        
PlayerInfo[playerid][pInteriorNr] = BizzInfo[i][bInteriorNr];
                        
SetPlayerVirtualWorld(playerid,BizzInfo[i][bVirWorld]);
                        
SafeSetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                        
SafeSetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                        new 
dood[MAX_PLAYER_NAME];
                        
GetPlayerName(playeriddoodsizeof(dood));
                        
BizzEntered[playerid] = i;
                        new 
h,mi,s,y,m,d;
                        
getdate(y,m,d);
                        
gettime(h,mi,s);
                        
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s payed $%d to enter biz %d",d,m,y,h,mi,sdoodBizzInfo[i][bEntranceCost], i);
                        
printf("%s"string);
                        
PayLog(string);
                        if(
BizzInfo[i][bVirWorld] == || BizzInfo[i][bVirWorld] == 1)
                        {
                            
OnPlayerEnterFood(playerid1);
                        }
                        else if(
BizzInfo[i][bVirWorld] == || BizzInfo[i][bVirWorld] == 3)
                        {
                            
OnPlayerEnterFood(playerid2);
                        }
                        else if(
BizzInfo[i][bVirWorld] == || BizzInfo[i][bVirWorld] == 5)
                        {
                            
OnPlayerEnterFood(playerid3);
                        }
                        else if(
BizzInfo[i][bVirWorld] == 6)
                        {
                            
OnPlayerEnterFood(playerid4);
                        }
                    }
                    else
                    {
                        
GameTextForPlayer(playerid"~r~You dont have the cash"50001);
                    }
                }
            } 
PHP код:
E:\samp\Evolutiomn Roleplay [ENG] - Copy\gamemodes\mazda.pwn(58934) : warning 213tag mismatch
E
:\samp\Evolutiomn Roleplay [ENG] - Copy\gamemodes\mazda.pwn(58934) : warning 213tag mismatch
E
:\samp\Evolutiomn Roleplay [ENG] - Copy\gamemodes\mazda.pwn(58934) : warning 213tag mismatch
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
Header size
:          16332 bytes
Code size
:          5766628 bytes
Data size
:          6672708 bytes
Stack
/heap size:      80000 bytesestimated maxusageunknowndue to recursion
Total requirements
:12535668 bytes
3 Warnings

Line 58934
PHP код:
GetPlayerPosplayeridg_pPosplayerid ][ ], g_pPosplayerid ][ ], g_pPosplayerid ][ ] ); 
Reply
#6

OH, sorry, that's my bad. You'll need to put "Float:" infront of the declaration of g_pPos:
pawn Код:
new
    Float:g_pPos[ MAX_PLAYERS ][ 3 ]
;
The tag mismatch error occurs because the function expects a variable tagged with "Float", hence the Float: part infront of g_pPos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)