31.10.2012, 20:05
hey everyone,
i have this code:
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
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");
}
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