need a lil help
#1

i need help on OnPlayerStateChange

i made it like this :

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid;
if(newstate == PLAYER_STATE_DRIVER)
{
SetPlayerArmedWeapon(playerid, 0);
}
if(GetVehicleModel(vehicleid) == 425 && gClass[playerid] != PILOT_CLASS && gClass[playerid] != DONOR_CLASS)
{
SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive Hunter");
RemovePlayerFromVehicle(playerid);
}

if(GetVehicleModel(vehicleid) == 520 && gClass[playerid] != PILOT_CLASS  && gClass[playerid] != DONOR_CLASS)
{

SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive Hydra");
RemovePlayerFromVehicle(playerid);
}
if(GetVehicleModel(vehicleid) == 432 && gClass[playerid] != ENGINEER_CLASS  && gClass[playerid] != DONOR_CLASS)

{
SendClientMessage(playerid, RED,"ERROR: You need to be Engineer/Donor to drive Rhino");
RemovePlayerFromVehicle(playerid);
}

if(GetVehicleModel(vehicleid) == 447 && gClass[playerid] != PILOT_CLASS  && gClass[playerid] != DONOR_CLASS)

{
SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive Sea-Sparrow");
RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
pawno is also not giving error or warning but when i go in game to test it doesnt works
Reply
#2

What error?Post it.
Reply
#3

Whats the error or warning?
Reply
#4

this should work.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
      SetPlayerArmedWeapon(playerid, 0);
      switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
      {
          case 425,432,447,520:
          {
             if(gClass[playerid] != PILOT_CLASS || gClass[playerid] != DONOR_CLASS) return SendClientMessage(playerid, RED,"ERROR: You need to be Pilot/Donor to drive this vehicle"),RemovePlayerFromVehicle(playerid);
          }
      }
    }
    return 1;
}
Reply
#5

that didnt worked but ill make it work thanks +Repped

Edit: still not working please help
Reply
#6

please help me... i tried all things not working,
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)