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(playerid, vehicleid, ispassenger)
{
if (gCar[vehicleid][vSigna])
{
signalisatsioon(vehicleid);
SCM(playerid, COLOR_LIGHTRED, "Sхiduki signalisatsioon hakkas tццle!");
}
if (groupVariables[vehicleVariables[vehicleid][vVehicleGroup]][gGroupType] == 8 && 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(playerid, COLOR_RED, "Sul pole piisavalt raha!");
}
taksomeeter[playerid] = 0;
taksomeeter[playerid] += taksohind[taksojuht];
new string[64];
format(string, sizeof(string), "Taksomeeter: %i$", taksomeeter[playerid]);
foreach (Player, i)
{
if (IsPlayerInVehicle(i, vehicleid)) GameTextForPlayer(i, string, 10000, 1);
}
}
}
}
}
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