Need Help - 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: Need Help (
/showthread.php?tid=333357)
Need Help -
RicaNiel - 11.04.2012
I got errors i got confused on it
here is the error
Код:
C:\Users\Daniel\SanAndreas Muliplayer\server\gamemodes\ricaniel.pwn(739) : error 032: array index out of bounds (variable "randomEngine")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
pawn Код:
CMD:engine(playerid)
{
new vid = GetPlayerVehicleID(playerid);
new randomEngine[][1] =
{
{VEHICLE_PARAMS_OFF},
{VEHICLE_PARAMS_ON}
};
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
new rand = random(sizeof(randomEngine));
SetVehicleParamsEx(vid,randomEngine[rand][1],lights,alarm,doors,bonnet,boot,objective);
}
return 1;
}
Re: Need Help -
zSuYaNw - 11.04.2012
pawn Код:
CMD:engine(playerid)
{
if(GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
new rand = random(1) ? VEHICLE_PARAMS_ON : VEHICLE_PARAMS_OFF;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),rand,lights,alarm,doors,bonnet,boot,objective);
}
return 1;
}
Re: Need Help -
TzAkS. - 11.04.2012
Код:
new randomEngine[2][1] =