17.11.2016, 21:16
Hello guys,i want to make when you enter in a car and you dont have a drivers license,it slaps you,
i made it,but the problem is that the player gets into the car and then it slaps him,i want him to be slapped when he presses f,without him getting to open the door and getting in the car,how do i do that?
i made it,but the problem is that the player gets into the car and then it slaps him,i want him to be slapped when he presses f,without him getting to open the door and getting in the car,how do i do that?
PHP код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
new vehicleid = GetPlayerVehicleID(playerid);
new carid = FindSpawnID(vehicleid);
if(CarInfo[carid][cID] != -2 && carid != 0)
{
format(string, sizeof(string), "* Acest %s este detinut de %s.", vehName[CarInfo[carid][cModel]-400],CarInfo[carid][cOwner]);
SendClientMessage(playerid, COLOR_WHITE, string);
}
new faction = PlayerData[playerid][Member] + PlayerData[playerid][Leader];
if(!(IsAPlane(vehicleid) || IsABoat(vehicleid) || IsABike(vehicleid)))
{
if(PlayerData[playerid][CarLic] == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+3);
SendClientMessage(playerid, COLOR_WHITE, "You don't have a driving license");
}