[Tutorial] Specefic Cars for Gangs
#1

Please Delete
Reply
#2

Quote:
Originally Posted by mahdi499
View Post
an array with 19 Slots [1 is null]
Nope, wrong. This is only true for strings, which this array is not. All strings are arrays but not all arrays are strings.
Reply
#3

Quote:
Originally Posted by Vince
View Post
Nope, wrong. This is only true for strings, which this array is not. All strings are arrays but not all arrays are strings.
Ok Thank you,i'll edit it now.
Reply
#4

Nice Tutorial. Good one.
Reply
#5

Thank you very much,I appreciate it
Reply
#6

Untested code.
RemovePlayerFromVehicle doesn't work in OnPlayerEnterVehicle, either detect the state change of the player or clear their animations under OnPlayerEnterVehicle.
Reply
#7

Thank you,i shall test and fix everything next time,in the mean time please delete it
Reply
#8

Not a really good way to do this actually, I would do it like this for best results.

This way there is no looping for checking car types since all types are predefined during vehicle creation in an array the vehicleid always references the array slot of the vehicle type.

pawn Code:
#define CAR_TYPE_COPCAR

new gCarData[MAX_VEHICLES] = { INVALID_VEHICLE_ID, ... };

public OnGameModeInit()
{
    AddDynamicCar(596,1595.3313,-1709.8433,5.6725,180.4009,16,1, 3600, CAR_TYPE_COPCAR);

}

stock AddDynamicCar(model, Float:cx, Float:cy: Float:cz, Float:cfa, color1, color2, respawndelay, cartype)
{
    new vindex = CreateVehicle(modelid, cx, cy, cz, cfa, color1, color2, respawndelay);
    if(vindex != INVALID_VEHICLE_ID)
    {
        gCarData[vindex] = cartype;
        return vindex;
    }
    return INVALID_VEHICLE_ID;
}

stock IsACopCar(carid)
{
   if(gCarData[carid] == CAR_TYPE_COPCAR) return 1;
   return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)