SA-MP Forums Archive
Typing /enter with a car :/ - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Typing /enter with a car :/ (/showthread.php?tid=167338)



Typing /enter with a car :/ - Luis- - 11.08.2010

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


Re: Typing /enter with a car :/ - pmk1 - 12.08.2010

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


Re: Typing /enter with a car :/ - Luis- - 12.08.2010

I need a better explanation D:


Re: Typing /enter with a car :/ - CSMajor - 12.08.2010

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


Re: Typing /enter with a car :/ - pmk1 - 12.08.2010

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


Re: Typing /enter with a car :/ - CSMajor - 12.08.2010

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


Re: Typing /enter with a car :/ - Thebest96 - 12.08.2010

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.


Re: Typing /enter with a car :/ - Mike_Peterson - 12.08.2010

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]");


Re: Typing /enter with a car :/ - sekol - 12.08.2010

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" ?


Re: Typing /enter with a car :/ - sekol - 12.08.2010

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