onplayerentervehicle
#1

i added
pawn Код:
if(modelid == 481 || 509 || 510) return SendClientMessage(playerid,red,"ERROR: You cannot on the engine for a bike");
under my /engine command but for some reason all vehicles shows that message, i did
pawn Код:
new modelid = GetVehicleModel(playerid);
this is my onplayerentervehicle script
pawn Код:
new vid = GetPlayerVehicleID(playerid);
    new modelid = GetVehicleModel(playerid);
    if(modelid == 481 || 509 || 510)
    {
        vengine[vid] = 1;
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid,true,lights,alarm,doors,bonnet,boot,objective);
    }
    if(vengine[vid] == 0)
    {
        SendClientMessage(playerid,lightyellow,"This vehicle engines are off, use /engine to on it");
    }
well i want if the model id is 481 509 510 (bicycles), it
Reply
#2

use it like:

pawn Код:
if(modelid == 481 || modelid == 509 || modelid == /*etc..*/)
Reply
#3

OnPlayerEnterVehicle is just called before entering the vehicle so GetPlayerVehicleID is useless because at that time that player is outside a vehicle. Try shifting it under ONPlayerStateChange.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)