19.07.2012, 03:49
Hello
i am trying to create a speedo meter so can you tell me any one what is wrong here?
Pwno:
i am trying to create a speedo meter so can you tell me any one what is wrong here?
Код:
C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1064) : error 010: invalid function or declaration C:\Documents and Settings\efa\My Documents\Test[0.3E]\gamemodes\Test.pwn(1067) : warning 235: public function lacks forward declaration (symbol "Speedometer") C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1078) : warning 217: loose indentation C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1079) : warning 217: loose indentation C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1084) : error 017: undefined symbol "HEALTH" C:\Documents and Settings\efa\My Documents\Test[0.3E]\gamemodes\Test.pwn(1084) : warning 215: expression has no effect C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1084) : error 001: expected token: ";", but found "]" C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1084) : error 029: invalid expression, assumed zero C:\Documents and Settings\efa\My Documents\Test [0.3E]\gamemodes\Test.pwn(1084) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Код:
new Text:SPEEDOS[MAX_PLAYERS]; SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," "); TextDrawShowForPlayer(playerid,SPEEDOS[playerid]); SetTimer("Speedometer", 10, true); public Speedometer(playerid) { new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int; vehicleid = GetPlayerVehicleID(playerid); if(vehicleid != 0) { GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z); final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672 = mph final_speed_int = floatround(final_speed,floatround_round); format(speed_string,256,"Speed: %i",final_speed_int); TextDrawSetString(SPEEDOS[playerid], speed_string); new Float:vehicle_health,final_vehicle_health,health_string[256]; if(vehicleid != 0) { GetVehicleHealth(vehicleid,vehicle_health); final_vehicle_health = floatround(floatround(vehicle_health - 250)/ 7.5); //This will make the health show at 100 when the vehicle is not damaged and at 0 when it is in fire. format(health_string,256,"Health %i", final_vehicle_health); TextDrawSetString(HEALTH[playerid], " "); TextDrawSetString(HEALTH[playerid], health_string); else { TextDrawSetString(SPEEDOS[playerid], " "); } else { TextDrawSetString(SPEEDOS[playerid], " "); } return 1; } new Text:HEALTH[MAX_PLAYERS]; HEALTH[playerid] = TextDrawCreate(10.0,200.0," "); TextDrawShowForPlayer(playerid,HEALTH[playerid]);