Problem with OnPLayerEnterVehicle
#1

I have a picture of OnPlayerEnterVehicle callback.

Why crashdetect says: Array Index out of bounds?

Reply
#2

Code?
Reply
#3

Sorry. here's the code.
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{            
    if (
gCar[vehicleid][vSigna])
    {
        
signalisatsioon(vehicleid);
        
SCM(playeridCOLOR_LIGHTRED"Sхiduki signalisatsioon hakkas tццle!");
    }
    if (
groupVariables[vehicleVariables[vehicleid][vVehicleGroup]][gGroupType] == && ispassenger)
    {
        new 
taksojuht GetVehicleDriver(vehicleid);
        if (
taksojuht != -1)
        {
            if (
groupVariables[playerVariables[taksojuht][pGroup]][gGroupType] == 8)
            {
                if (
taksohind[taksojuht] != -1)
                {
                    if (
playerVariables[playerid][pMoney] < taksohind[taksojuht])
                    {
                        
RemovePlayerFromVehicle(playerid);
                        
SCM(playeridCOLOR_RED"Sul pole piisavalt raha!");
                    }
                    
taksomeeter[playerid] = 0;
                    
taksomeeter[playerid] += taksohind[taksojuht];
                    new 
string[64];
                    
format(stringsizeof(string), "Taksomeeter: %i$"taksomeeter[playerid]);
                    foreach (
Playeri)
                    {
                        if (
IsPlayerInVehicle(ivehicleid)) GameTextForPlayer(istring100001);
                    }
                }
            }
        }
    }
    if (
t88timer[playerid] != -1)
    {
        if (
vehicleid == t88autoid[playerid])
        {
            
KillTimer(t88timer[playerid]);
            
t88timer[playerid] = -1;
        }
    }
    return 
1;

Reply
#4

Compile it in debug mode (create a file named pawn.cfg where your pawno.exe is), write in it -d3 -r and compile it, and crashdetect will show you the error line, or use https://sampwiki.blast.hk/wiki/Debugging
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)