11.07.2015, 00:42
My fault.. x)
Try this one :
Try this one :
PHP код:
new IsInVeh[MAX_PLAYERS];
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == your id)
{
SetTimerEx("Message", 5000, false, "i", playerid);
IsInVeh[playerid] = 1;
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
IsInVeh[playerid] = 0;
return 1;
}
forward Message(playerid);
public Message(playerid)
{
SendClientMessage(playerid, -1, "Welcome to the vehicle.");
SetTimerEx("Explosion", 5000, false, "i", playerid);
return 1;
}
forward Explosion(playerid);
public Explosion(playerid)
{
if(IsInVeh[playerid] = 1)
{
new pveh =GetPlayerVehicleID(playerid);
new Float:x, Float:y, Float:z
GetVehiclePos(pveh, x, y, z);
CreateExplosion(x,y,z,12, 10.0);
SendClientMessage(playerid, -1, "Trapped LOL.");
}
return 1;
}