Enter more vehicle to drive.
#1

pawn Код:
new DriversTest[4];
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid == DriversTest[4])
        {
            if(AllowTakeLCar[playerid] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SCM(playerid, COLOR_RED, "------------------------------------------");
                    SCM(playerid, COLOR_BLUE, "Notes for drivers/motor license.");
                    SCM(playerid, COLOR_GREEN, "Don't crash the car!");
                    SCM(playerid, COLOR_GREEN, "Don't ride thru red!");
                    SCM(playerid, COLOR_GREEN, "Don't speed MAX 50 km/h");
                    SetPlayerCheckpoint(playerid, 1726.6279,1288.2347,10.3990, 2.5);
                    SCM(playerid, COLOR_RED, "------------------------------------------");
                    Ccp[playerid] = 1;
                }
            }
            else if(AllowTakeLCar[playerid] == 0)
            {
                SCM(playerid, -1, "Your not taking a test!");
                return RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
pawn Код:
DriversTest[0] = AddStaticVehicleEx(426,1641.2000000,1293.3000000,10.6000000,270.0000000,254,254,15000); //Premier
    DriversTest[1] = AddStaticVehicleEx(426,1641.2000000,1296.4000000,10.6000000,270.0000000,254,254,15000); //Premier
    DriversTest[2] = AddStaticVehicleEx(426,1641.2000000,1299.5000000,10.6000000,270.0000000,254,254,15000); //Premier
    DriversTest[3] = AddStaticVehicleEx(426,1641.1000000,1302.3000000,10.6000000,270.0000000,254,254,15000); //Premier
Error
Код:
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(832) : error 032: array index out of bounds (variable "DriversTest")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Error line:
if(vehicleid == DriversTest[4])
Reply


Messages In This Thread
Enter more vehicle to drive. - by Mey6155 - 27.05.2014, 13:50
Re: Enter more vehicle to drive. - by Konstantinos - 27.05.2014, 13:54
Re: Enter more vehicle to drive. - by NaClchemistryK - 27.05.2014, 13:54

Forum Jump:


Users browsing this thread: 2 Guest(s)