Teleport Command Not Working
#1

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
Reply
#2

new currentveh;

You never set it to a value, so it remains 0.

new currentveh = GetPlayerVehicleID(playerid);
Reply
#3

Ohh Silly Me Thnx Mr. mp2 +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)