Teleport cars HELP!!!
#1

please anyone help me!!!!!!!
i made a command that teles a player but if he is in a car i want it to tele him and the car i can do it no probs but it dosnt put him in the car so i tried to make it it works but i get this with server unknown command :



then if he isnt in a car it dosnt tele him it gives the same error and it dosnt tele!!!
help me please!!!!
code is:
PHP Code:
if (IsPlayerInAnyVehicle(playerid)== 1)
        
SetVehiclePos(GetPlayerVehicleID(playerid), 1458.1984,1559.2050,10.8125);
        
PutPlayerInVehicle(playerid);
        }else{
        
SendClientMessage(playerid,COLOR_GREEN"Welcome to Stunt2");
        
SetPlayerPos(playerid,1458.1984,1559.2050,10.8125);
        return 
1;

Reply
#2

pawn Code:
if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), 1458.1984,1559.2050,10.8125);
else SetPlayerPos(playerid,1458.1984,1559.2050,10.8125);
SendClientMessage(playerid,COLOR_GREEN, "Welcome to Stunt2");
//return and end your command with }
You can use [ pawn] and [ /pawn] btw.
Reply
#3

THANKS DDDDDDDDDDDDDDDDDDDDDDDDDDD it worked!!!!!
Reply
#4

Braces don't match. Does that even compile?
And like I already said in one of your previous topics, PutPlayerInVehicle has two additional parameters.

pawn Code:
new
    vehicleid = GetPlayerVehicleID(playerid);

if (vehicleid)
{
        SetVehiclePos(vehicleid, 1458.1984,1559.2050,10.8125);
        PutPlayerInVehicle(playerid, vehicleid, 0);
}
else
{
        SetPlayerPos(playerid,1458.1984,1559.2050,10.8125);
}
SendClientMessage(playerid,COLOR_GREEN, "Welcome to Stunt2");
return 1;
Reply
#5

Learn to search even ******* have a tutorial! Here:
[pawn] if(strcmp(cmdtext,"teleport",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid,**Interior**);
SetPlayerInterior(playerid,**Interior**);
return SetVehiclePos(vehicleid,**Co-ords**);
}
SetPlayerPos(playerid,**Co-ords**);
SetPlayerInterior(playerid,**Interior**);
return 1;
}
[/pawn[

Don't waste my time! This is also copied from a tutorial.
Reply
#6

Quote:
Originally Posted by expertprogrammer
View Post
Learn to search even ******* have a tutorial! Here:
[pawn] if(strcmp(cmdtext,"teleport",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid,**Interior**);
SetPlayerInterior(playerid,**Interior**);
return SetVehiclePos(vehicleid,**Co-ords**);
}
SetPlayerPos(playerid,**Co-ords**);
SetPlayerInterior(playerid,**Interior**);
return 1;
}
[/pawn[

Don't waste my time! This is also copied from a tutorial.
How about you become a nice person, and learn to speak English.. Or don't post.
Reply
#7

Quote:
Originally Posted by expertprogrammer
View Post
Learn to search even ******* have a tutorial!

Don't waste my time! This is also copied from a tutorial.
The scripting discussion board is created for asking help, stop "wasting your time" with arguing here, it's not the right place for that.
Also, if you read carefully the previous posts, you'll see that the problem has been solved before you posted your crappy post.
Reply
#8

yeh that expertprogrammer is a bit out of order here its a scripting boar people ask questions to each other and friendly people help!!! and ur code i wrong i need to define stuff but since u were lasy im going to and remeber when u copyed my gamemode?ok...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)