Typing /enter with a car :/
#1

I would like to know how to enter/exit a building with a car?
Reply
#2

you must do something in your command like
if IsPlayerInVehicle(playerid)
{ //your command, plus somehting with attachvechiletointerior and setvehiclepos
return 1;
}
i think :\
Reply
#3

I need a better explanation D:
Reply
#4

pawn Код:
if(!strcmp(cmdtext,"/enter",true,6)) return SendClientMessage(playerid,0xFFF0000FF,"USAGE: /enter [Interior ID]");
{
if(IsPlayerInVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid),cmdtext[7]);
}
else
{
SendClientMessage(playerid,0xFFF0000FF,"You Are Not In A Vehicle!");
}
return 1;
}

please post the errors you get as i have not tested it
Reply
#5

or you can do
pawn Код:
if(!strcmp(cmdtext,"/enter",true,6))
{
if(IsPlayerInVehicle(playerid))
{
SetPlayerinterior(playerid, id)
LinkVehicleToInterior(GetPlayerVehicleID(playerid),cmdtext[7]);
SetVehiclePos(playerid, X,Y,Z,A) // not sure of it :\ makes a while i ddidnt use that
}
else
{
SetPlayerinterior(playerid, id)
SetPlayerPos(playerid, X,Y,Z,A) // not sure of it :\ makes a while i ddidnt use that
}
return 1;
}
or something like that :P hope this helps and as i said, i'm not totaly sure it works cuz it makes a while i didnt pawnoed xd
Reply
#6

the other dudes below me well his wont work because he had to define id and alot of other stuff like xyz etc
Reply
#7

Quote:
Originally Posted by pmk1
Посмотреть сообщение
or you can do
pawn Код:
if(!strcmp(cmdtext,"/enter",true,6))
{
if(IsPlayerInVehicle(playerid))
{
SetPlayerinterior(playerid, id)
LinkVehicleToInterior(GetPlayerVehicleID(playerid),cmdtext[7]);
SetVehiclePos(playerid, X,Y,Z,A) // not sure of it :\ makes a while i ddidnt use that
}
else
{
SetPlayerinterior(playerid, id)
SetPlayerPos(playerid, X,Y,Z,A) // not sure of it :\ makes a while i ddidnt use that
}
return 1;
}
or something like that :P hope this helps and as i said, i'm not totaly sure it works cuz it makes a while i didnt pawnoed xd
THANKS!!!! helped me a lot.
Reply
#8

Quote:
Originally Posted by CSMajor
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext,"/enter",true,6)) return SendClientMessage(playerid,0xFFF0000FF,"USAGE: /enter [Interior ID]");
{
if(IsPlayerInVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid),cmdtext[7]);
}
else
{
SendClientMessage(playerid,0xFFF0000FF,"You Are Not In A Vehicle!");
}
return 1;
}

please post the errors you get as i have not tested it
cmdtext = /enter
cmd = /enter (id)
:P so use

if(!strcmp(cmd(deleted text),"/enter",true,6)) return SendClientMessage(playerid,0xFFF0000FF,"USAGE: /enter [Interior ID]");
Reply
#9

Quote:
Originally Posted by pmk1
Посмотреть сообщение
or you can do
pawn Код:
if(!strcmp(cmdtext,"/enter",true,6))
{
if(IsPlayerInVehicle(playerid))
{
SetPlayerinterior(playerid, id)
LinkVehicleToInterior(GetPlayerVehicleID(playerid),cmdtext[7]);
SetVehiclePos(playerid, X,Y,Z,A) // not sure of it :\ makes a while i ddidnt use that
}
else
{
SetPlayerinterior(playerid, id)
SetPlayerPos(playerid, X,Y,Z,A) // not sure of it :\ makes a while i ddidnt use that
}
return 1;
}
or something like that :P hope this helps and as i said, i'm not totaly sure it works cuz it makes a while i didnt pawnoed xd
How should i replace "A" ?
Reply
#10

Quote:
Originally Posted by sekol
Посмотреть сообщение
How should i replace "A" ?
And what does mean
Код:
 cmdtext[7]);
Shit, i wished to edit it, not doublepost. Sorry guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)