SA-MP Forums Archive
[QUESTION] Is Vehicle Sport Car - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [QUESTION] Is Vehicle Sport Car (/showthread.php?tid=207949)



[QUESTION] Is Vehicle Sport Car - Larsey123IsMe - 07.01.2011

Why dosent this work?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsVehicleSportCar(playerid))
    {
        SendClientMessage(playerid,0x007F0EFF,"You entered a sport car.");
    }
    return 1;
}
pawn Код:
stock IsVehicleSportCar(playerid)
{
    new vehicleid;
    vehicleid = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vehicleid) == 411 || 541 || 451) return 0;
    return 0;
}



Re: [QUESTION] Is Vehicle Sport Car - Voldemort - 07.01.2011

Here you go

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsVehicleSportCar(vehicleid))
    {
        SendClientMessage(playerid,0x007F0EFF,"You entered a sport car.");
    }
    return 1;
}

IsVehicleSportCar(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 441,541,541: { return 1; }
    }
    return 0;
}



Re: [QUESTION] Is Vehicle Sport Car - Larsey123IsMe - 07.01.2011

error 040: duplicate "case" label (value 541)

:S


Re: [QUESTION] Is Vehicle Sport Car - Voldemort - 07.01.2011

just change IDs to your vehicle models


Re: [QUESTION] Is Vehicle Sport Car - Larsey123IsMe - 07.01.2011

Quote:
Originally Posted by Voldemort
Посмотреть сообщение
just change IDs to your vehicle models
Oh, LoL, Thanks