SA-MP Forums Archive
[HELP]: OnPlayerEnterVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]: OnPlayerEnterVehicle (/showthread.php?tid=456289)



[HELP]: OnPlayerEnterVehicle - Areax - 05.08.2013

Hey guys!

I have a problem...

This don't work, i don't know why

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == 425 && gPlayerClass[playerid] != PILOT)
    {
    SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}You Need to be a Pilot to fly {FF0000}Hunter{FFFFFF}!");
    RemovePlayerFromVehicle(playerid);
    }
    if(vehicleid == 520 && gPlayerClass[playerid] != PILOT)
    {
    SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}You Need to be a Pilot to fly {FF0000}Hydra{FFFFFF}!");
    RemovePlayerFromVehicle(playerid);
    }
    return 1;
}



Re: [HELP]: OnPlayerEnterVehicle - FiReAlEx - 05.08.2013

Do it sends the message?


Re: [HELP]: OnPlayerEnterVehicle - Areax - 05.08.2013

Quote:
Originally Posted by FiReAlEx
Посмотреть сообщение
Do it sends the message?
No..


Re: [HELP]: OnPlayerEnterVehicle - FiReAlEx - 05.08.2013

Try this
Код:
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] != PILOT)



Re: [HELP]: OnPlayerEnterVehicle - Vanter - 05.08.2013

Here
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] != PILOT)
    {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] You must be a pilot in order to fly a hydra.");
            ClearAnimations(playerid,1);
            return 1;
       }
       return 1;
}
that's working


Re: [HELP]: OnPlayerEnterVehicle - redreaper666 - 05.08.2013

try using
if(GetPlayerVehicleID(playerid) == 425 && gPlayerClass[playerid] != PILOT)


Re: [HELP]: OnPlayerEnterVehicle - Areax - 05.08.2013

Quote:
Originally Posted by Vanter
Посмотреть сообщение
Here
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] != PILOT)
    {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] You must be a pilot in order to fly a hydra.");
            ClearAnimations(playerid,1);
            return 1;
       }
       return 1;
}
that's working
This works Thanks!


Re: [HELP]: OnPlayerEnterVehicle - DeMoX - 05.08.2013

Are you sure that your class system is alright? it might be a fail on it too


Re: [HELP]: OnPlayerEnterVehicle - Areax - 05.08.2013

Quote:
Originally Posted by DeMoX
Посмотреть сообщение
Are you sure that your class system is alright? it might be a fail on it too
What do you mean?


Re: [HELP]: OnPlayerEnterVehicle - Vanter - 05.08.2013

Areax, since my thing worked fine, then your class definition is working fine