SA-MP Forums Archive
class teleporting problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: class teleporting problem (/showthread.php?tid=389109)



class teleporting problem - niels44 - 31.10.2012

hey everyone,

i have this code:
pawn Код:
CMD:woods(playerid, params[])
{
    if(PlayerInfo[playerid][World] == StuntWorld)
    {
        if(!IsPlayerInAnyVehicle(playerid)){
            SetPlayerPos(playerid, -557.2169,-3742.1411,3.6250);
            SetPlayerFacingAngle(playerid, 321.6286);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);
        }
        else{
            new veh = GetPlayerVehicleID(playerid);
            SetVehiclePos(veh, -547.8927,-3666.5413,3.3521);
            SetVehicleZAngle(veh, 220.5547);
            LinkVehicleToInterior(veh, 0);
            SetVehicleVirtualWorld(veh, 0);
            PutPlayerInVehicle(playerid, veh, 0);
        }
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FF0000}(/woods) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}The Woods Race",pName);
        SendClientMessageToAll(playerid, string);
        TogglePlayerControllable(playerid, 0);
        SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
        GameTextForPlayer(playerid,"~g~Waiting for the Environment to load",2000,3);
        return SendClientMessage(playerid, 0x00FF00FF, "Welcome to  The Woods Race");
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: you need to be in the Stunt World to use this teleport");
}
and the player should only be able to teleport to woods if he is in StuntWorld.
but problem is it also works when in driftworld, it shouldnt do this at all, it should send the message you need to be in the stunt world to use this teleport, but it doesnt, it just teleports the player, but i dont see the problem...

anyone knows wut i do wrong here?

greets niels


Re: class teleporting problem - PrawkC - 31.10.2012

Are you sure "PlayerInfo[playerid][World]" is being set to DriftWorld when the person is there?


Re: class teleporting problem - niels44 - 01.11.2012

yes it does, but somehow the bugg is fixed now, but the objects of the drift world dont showup anymore -_-, anyone has a clue for it?

this is wut i use for the objects of drift world, which spawn in world 1, same as player if he chooses Drift World at classselection:

pawn Код:
CreateDynamicObject(2773, -296.10000610, 1508.19995117, 74.90000153, 0.00000000, 0.00000000, 0.00000000, 1, 0, -1, 250);
anyone knows why the objects of the drifts dont work?