RC Vehicles problem! - 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: RC Vehicles problem! (
/showthread.php?tid=205999)
RC Vehicles problem! -
Marios - 02.01.2011
I have put some RC vehicles in my server, but when i go to to enter, i press the enter button and i can't, nobody can enter them. Why
Re: RC Vehicles problem! -
Backwardsman97 - 02.01.2011
You need to download a script for them to work since by default, they don't.
Re: RC Vehicles problem! -
gereter - 02.01.2011
Or you can do command for enter in.
pawn Код:
if (strcmp("/enter", cmdtext, true, 8) == 0)
{
new playerState = GetPlayerState(playerid);
new carid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(!IsPlayerInRangeOfPoint(playerid,5.0, -3511.0151,-74.2591,20.2049))return SendClientMessage(playerid, darkred, "You are not near the Rc car");// coordiantes where you have put your RC car
if (playerState == PLAYER_STATE_DRIVER || playerState == PLAYER_STATE_PASSENGER)return SendClientMessage(playerid,darkred,"** You already have a vehicle.");
if(IsPlayerInRangeOfPoint(playerid,5.0, -3511.0151,-74.2591,20.2049))
{
PutPlayerInVehicle(playerid,carid,0);
return 1;
}
}
This will work only if the car is at this location not if somebody took it and have put it somewhere else
There is something easier to do is a cmd to have this car example:
pawn Код:
if (strcmp("/rccar", cmdtext, true, 8) == 0)
{
new playerState = GetPlayerState(playerid);
if (playerState != PLAYER_STATE_DRIVER || playerState != PLAYER_STATE_PASSENGER)
{
PutPlayerInVehicle(playerid,carid,0);//replace carid by the id of the rc car
}
else
{
SendClientMessage(playerid,darkred,"** You already have a vehicle.");
return 1;
}
}