Need help with a script
#1

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.
Reply
#2

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

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

pawn Код:
new ChGas[MAX_PLAYERS];
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)