SA-MP Forums Archive
Need help with a script - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with a script (/showthread.php?tid=138996)



Need help with a script - mike555 - 03.04.2010

People, please help me with a script.

I have some errors.
This is the script:
Код:
public CheckSpeed(playerid)
{
new Float:x,Float:y,Float:z;
new Float:distance,value;
new i = playerid;
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
new VID;
VID = GetPlayerVehicleID(i);
GetPlayerPos(i, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
value = floatround(distance * 5000);
if(UpdateSeconds > 1)
{
value = floatround(value / UpdateSeconds);
}
if(SpeedMode)
{
}
if(value == 0)
{
ChGas[i]++;//(50691 строка)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if(ChGas[i]>=30) {
Gas[VID]++;ChGas[i]=0;
}
}
SavePlayerPos[i][LastX] = x;
SavePlayerPos[i][LastY] = y;
SavePlayerPos[i][LastZ] = z;
}
}
value = floatround(value/1000);
new v = value;
return v;
}
These are errors;
Код:
C:\школа\SFRP4.pwn(50691) : error 017: undefined symbol "ChGas"
C:\школа\SFRP4.pwn(50691) : warning 215: expression has no effect
C:\школа\SFRP4.pwn(50691) : error 001: expected token: ";", but found "]"
C:\школа\SFRP4.pwn(50691) : error 029: invalid expression, assumed zero
Hope, you'll help me.


Re: Need help with a script - mike555 - 05.04.2010

Anybody could even help me? Are you so lazy to help the beginner?


Re: Need help with a script - Khelif - 05.04.2010

Add this on top of your script, hope that solves your problem

pawn Код:
new ChGas[MAX_PLAYERS];



Re: Need help with a script - mike555 - 06.04.2010

Quote:
Originally Posted by ɱર.⒮⒠⒱⒠⒩⒮⒯⒜⒭
Add this on top of your script, hope that solves your problem

pawn Код:
new ChGas[MAX_PLAYERS];
Will try