SA-MP Forums Archive
Problem with OnPLayerEnterVehicle - 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)
+--- Thread: Problem with OnPLayerEnterVehicle (/showthread.php?tid=444032)



Problem with OnPLayerEnterVehicle - Ld Est Ld - 14.06.2013

I have a picture of OnPlayerEnterVehicle callback.

Why crashdetect says: Array Index out of bounds?




Re: Problem with OnPLayerEnterVehicle - SilverKiller - 14.06.2013

Code?


Re: Problem with OnPLayerEnterVehicle - Ld Est Ld - 14.06.2013

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;




Re: Problem with OnPLayerEnterVehicle - IstuntmanI - 14.06.2013

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