OnPlayerEnterVehicle
#3

pawn Код:
bool:IsVipVehicle(vehicleid)
{

    for(new i=0; i != sizeof(amxxbg); i++)
        if(vehicleid == amxxbg[i])
            return true;

    return false;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsVipVehicle(vehicleid))
    {
        if(PlayerInfo[playerid][pMember] != TEAM_VIP)
        {
            new Float:shealth;
            new Float:slx, Float:sly, Float:slz;
            GetPlayerHealth(playerid, shealth);
            SetPlayerHealth(playerid, shealth-5);
            GetPlayerPos(playerid, slx, sly, slz);
            SetPlayerPos(playerid, slx+2, sly, slz);
            PlayerPlaySound(playerid, 1130, slx, sly, slz+5);
            SendClientMessage(playerid, -1, "{808080}You can't drive VIP Gang vehicles");
        }
    }
    return 1;
}
EDIT

Use zPain code is better
Reply


Messages In This Thread
OnPlayerEnterVehicle - by maxy153 - 29.09.2013, 22:09
Re: OnPlayerEnterVehicle - by EiresJason - 29.09.2013, 22:14
Re: OnPlayerEnterVehicle - by Jefff - 29.09.2013, 22:16
Re: OnPlayerEnterVehicle - by zPain - 29.09.2013, 22:17
Re: OnPlayerEnterVehicle - by maxy153 - 29.09.2013, 22:22

Forum Jump:


Users browsing this thread: 1 Guest(s)