Teleport Command Not Working - 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: Teleport Command Not Working (
/showthread.php?tid=431535)
Teleport Command Not Working -
Noobishplayer - 18.04.2013
Hello Guys
I Have a Problem Here which i want to discuss with you guys
Here's my Teleport Command
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/lv", true) == 0)
{
new currentveh;
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(currentveh,2166.6984, 1676.9652, 21.5445);
SetVehicleZAngle(currentveh, 87.2219);
}
if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
SetPlayerPos(playerid, 2182.2583, 1684.5372, 27.0495);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 134.2224);
return 1;
}
return 0;
}
The Problem Is When The Player is On Vehicle The /lv Command Doesnt Works
And When the player is On Foot The Command Works
Re: Teleport Command Not Working -
MP2 - 18.04.2013
new currentveh;
You never set it to a value, so it remains 0.
new currentveh = GetPlayerVehicleID(playerid);
Re: Teleport Command Not Working -
Noobishplayer - 18.04.2013
Ohh Silly Me Thnx Mr. mp2 +rep