4 errors...:-/ help ,
#1

i am getting these 4 error i dont know how to fix them

that would be nice if you would help me out.
Here Is The Code.
Код:
Timer:ServerMicrobeat[250]()
{
new
Float: fExpHealth,
Float: fCurrentSpeed,
iVehicle,
szSpeed[42],
arrVehParams[7],
arrDamage[4];

foreach(Player, i)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
if(arr_Towing[i] != INVALID_VEHICLE_ID) {
if(GetVehicleModel(arr_Towing[i]) && IsVehicleStreamedIn(arr_Towing[i], i)) AttachTrailerToVehicle(arr_Towing[i], GetPlayerVehicleID(i));
else arr_Towing[i] = INVALID_VEHICLE_ID;
}

fCurrentSpeed = player_get_speed(i);
if(PlayerInfo[i][pAdmin] <= 1) switch(Seatbelt[i]) {
case 0: if(fVehSpeed[i] - fCurrentSpeed > 40.0) GetPlayerHealth(i, fExpHealth), SetPlayerHealth(i, fExpHealth - (fVehSpeed[i] - fCurrentSpeed) / 2.0);
default: if(fVehSpeed[i] - fCurrentSpeed > 40.0) GetPlayerHealth(i, fExpHealth), SetPlayerHealth(i, fExpHealth - ((fVehSpeed[i] - fCurrentSpeed) / 4.0);
}
fVehSpeed[i] = fCurrentSpeed;
iVehicle = GetPlayerVehicleID(i);

GetVehicleHealth(iVehicle,fExpHealth);
if(fExpHealth < 350.0)
{
SetVehicleHealth(iVehicle, 251.0);
GetVehicleParamsEx(iVehicle, arrVehParams[0], arrVehParams[1], arrVehParams[2], arrVehParams[3], arrVehParams[4], arrVehParams[5], arrVehParams[6]);
if(arrVehParams[0] == VEHICLE_PARAMS_ON) SetVehicleParamsEx(iVehicle,VEHICLE_PARAMS_OFF, arrVehParams[1], arrVehParams[2], arrVehParams[3], arrVehParams[4], arrVehParams[5], arrVehParams[6]);
GameTextForPlayer(i, "~r~Totalled!", 2500, 3);
arr_Engine{iVehicle} = 0;
}
else if(PlayerInfo[i][pSpeedo] != 0 && FindTimePoints[i] == 0 && arr_Engine{iVehicle} == 1) {
format(szSpeed, sizeof(szSpeed),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%.0f MPH", fCurrentSpeed);
GameTextForPlayer(i, szSpeed, 1500, 3);
}
for(new s=0;s<10;s++)
{
if(SpikeStrips[s][sX] != 0) // Reduced from three vars to one
{
if(VehicleToPoint( 3.0, iVehicle, SpikeStrips[s][sX], SpikeStrips[s][sY], SpikeStrips[s][sZ]))
{
GetVehicleDamageStatus(iVehicle, arrDamage[0], arrDamage[1], arrDamage[2], arrDamage[3]);
arrDamage[3] = encode_tires(1, 1, 1, 1);
UpdateVehicleDamageStatus(iVehicle, arrDamage[0], arrDamage[1], arrDamage[2], arrDamage[3]);
}
}
}
}
else if(GetPlayerState(i) == PLAYER_STATE_PASSENGER) {
fCurrentSpeed = player_get_speed(i);
if(PlayerInfo[i][pAdmin] <= 1) switch(Seatbelt[i]) {
case 0: if(fVehSpeed[i] - fCurrentSpeed > 40.0) GetPlayerHealth(i, fExpHealth), SetPlayerHealth(i, fExpHealth - (fVehSpeed[i] - fCurrentSpeed) / 2.0);
default: if(fVehSpeed[i] - fCurrentSpeed > 40.0) GetPlayerHealth(i, fExpHealth), SetPlayerHealth(i, fExpHealth - ((fVehSpeed[i] - fCurrentSpeed) / 4.0));
}
fVehSpeed[i] = fCurrentSpeed;
}
}
}
And The Errors..
Код:
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95959) : error 017: undefined symbol "fVehSpeed"
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95959) : warning 215: expression has no effect
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95959) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95959) : warning 215: expression has no effect
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95959) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95959) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

what r the errors
Reply
#3

Quote:
Originally Posted by shaniyal
Посмотреть сообщение
what r the errors
My Bad I Forgot To Add The Errors ,, Its There now .
Reply
#4

If you are using enums then you have a undefined enum.
Reply
#5

Nope Still Doesnt Work ..
Reply
#6

Uh... add:
pawn Код:
new Float:fVehSpeed[MAX_PLAYERS];
to the top of your script.
Reply
#7

Still getting 2 Errors...


Код:
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95966) : error 001: expected token: ",", but found ";"
C:\Documents and Settings\User\Desktop\New Folder\N-rp backup\npcmodes\Test123.pwn(95991) : error 017: undefined symbol "encode_tires"
EDITED:line 95966
Код:
case 0: if(fVehSpeed[i] - fCurrentSpeed > 40.0) GetPlayerHealth(i, fExpHealth), SetPlayerHealth(i, fExpHealth - (fVehSpeed[i] - fCurrentSpeed) / 2.0);
line 95991
Код:
arrDamage[3] = encode_tires(1, 1, 1, 1);
Reply
#8

Bumpy ...
Reply
#9

I Think the error is a ; or "); something like that
Reply
#10

pawn Код:
case 0: if((fVehSpeed[i] - fCurrentSpeed) > 40.0) GetPlayerHealth(i, fExpHealth), SetPlayerHealth(i, (fExpHealth - (fVehSpeed[i] - fCurrentSpeed)) / 2.0));
pawn Код:
arrDamage[3] = 1111;
Not too sure about the last one, but it should work.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)