02.01.2011, 20:25
Or you can do command for enter in.
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("/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;
}
}
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;
}
}