[HELP]: OnPlayerEnterVehicle
#1

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;
}
Reply
#2

Do it sends the message?
Reply
#3

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

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

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
Reply
#6

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

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!
Reply
#8

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

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?
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)