10.12.2013, 11:11
(
Последний раз редактировалось dakata994; 10.12.2013 в 12:09.
)
PROBLEM SOLVED!!! Thanks to ghost556 ! He is +REPPED.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == BallasCar1 || BallasCar2 || BallasCar3 || BallasCar4 || BallasCar5 || BallasCar6)
{
if(PlayerInfo[playerid] [pBallas] < 1)
{
SendClientMessage(playerid,COLOR_PINK, "Ballas Car");
SetTimerEx("BallasRFV",2000,false,"i", playerid);//In two seconds after entering the car(pressing F/ENTER),BallasRFW(playerid); will be called
}
}
return 1;
}
forward BallasRFV(playerid); //Ballas Remove Player From Vehicle
public BallasRFV(playerid)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_PINK,"You cannot drive Ballas Cars!");
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == BallasCar1 || BallasCar2 || BallasCar3 || BallasCar4 || BallasCar5 || BallasCar6) { if(PlayerInfo[playerid] [pBallas] < 1) { ClearAnimations(playerid); SendClientMessage(playerid,COLOR_PINK, "Ballas Car"); } return 1; } return 1; }
You returned the timer after the 'if' statement.
No further code will be executed,like that message. Also you should could use SetTimerEx,as you got playerid So you can put it like this: pawn Код:
|
BallasCar1 = CreateVehicle(566, 2001.8361, -1143.2703, 25.3445, 89.0000, -1, -1, 100); BallasCar2 = CreateVehicle(566, 1992.5623, -1128.3490, 25.6445, 89.0000, -1, -1, 100); BallasCar3 = CreateVehicle(517, 2004.4861, -1120.9596, 26.5874, 179.0000, -1, -1, 100); BallasCar4 = CreateVehicle(517, 2013.1475, -1121.1638, 26.5874, 179.0000, -1, -1, 100); BallasCar5 = CreateVehicle(482, 1992.9958, -1119.0502, 26.8656, -90.0000, -1, -1, 100); BallasCar6 = CreateVehicle(567, 2018.8954, -1128.4579, 25.1946, 89.0000, -1, -1, 100);
new BallasCar[6];
BallasCar[0] = CreateVehicle(566, 2001.8361, -1143.2703, 25.3445, 89.0000, -1, -1, 100); BallasCar[1] = CreateVehicle(566, 1992.5623, -1128.3490, 25.6445, 89.0000, -1, -1, 100); BallasCar[2] = CreateVehicle(517, 2004.4861, -1120.9596, 26.5874, 179.0000, -1, -1, 100); BallasCar[3] = CreateVehicle(517, 2013.1475, -1121.1638, 26.5874, 179.0000, -1, -1, 100); BallasCar[4] = CreateVehicle(482, 1992.9958, -1119.0502, 26.8656, -90.0000, -1, -1, 100); BallasCar[5] = CreateVehicle(567, 2018.8954, -1128.4579, 25.1946, 89.0000, -1, -1, 100);
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { for(new i = 0; i < 12; i++) { if(vehicleid == BallasCar[i]) { if(pInfo[playerid][pMember] != 2) // Change this to your bits { ClearAnimations(playerid); SendClientMessage(playerid, -1, "[Los Santos Ambulance Service] You need to be a basic paramedic to drive a EMS car."); // Change this to what you want it to say } } return 1; }