Hunter only for specific class
#6

Quote:
Originally Posted by Abagail
Посмотреть сообщение
pawn Код:
new PlayerClass[MAX_PLAYERS] = CLASS_NONE;
public OnPlayerRequestClass(playerid,classid)
{
    if(classid == CLASS_HUNTER)
    {
    PlayerClass[playerid] = CLASS_HUNTER;
    }

    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == 426 && PlayerClass[playerid] != CLASS_HUNTER)
        return ClearAnimations(playerid);

    return true;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 426 && PlayerClass[playerid] != CLASS_HUNTER)
    {
        RemovePlayerFromVehicle(playerid);
    }

        return true;
}
Adjust this to your script, this is just an example.

Thank you but this is not working. I got this error:

PHP код:
array index out of bounds (variable "gPlayerClass"
My line:

PHP код:
if(vehicleid == 426 && gPlayerClass[MAX_PLAYERS] != PILOT
What can i do to fix this?
Reply


Messages In This Thread
Hunter only for specific class - by Fantje - 01.05.2016, 19:43
Re: Hunter only for specific class - by Manyula - 01.05.2016, 20:07
Re: Hunter only for specific class - by Fantje - 01.05.2016, 20:11
Re: Hunter only for specific class - by Abagail - 01.05.2016, 20:18
Re: Hunter only for specific class - by iKevin - 01.05.2016, 20:19
Re: Hunter only for specific class - by Fantje - 02.05.2016, 09:26
Re: Hunter only for specific class - by itsCody - 02.05.2016, 09:31
Re: Hunter only for specific class - by Fantje - 02.05.2016, 09:32
Re: Hunter only for specific class - by Fantje - 02.05.2016, 09:34
Re: Hunter only for specific class - by Ritzy2K - 02.05.2016, 09:56

Forum Jump:


Users browsing this thread: 2 Guest(s)