SA-MP Forums Archive
Errors - 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: Errors (/showthread.php?tid=130740)



Errors - ReactionGameServers - 28.02.2010

Hey,

I added a speedometer to my script and i get some errors compiling

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && !DeActiveSpeedometer[playerid])
    {
        for(new i; i < 15; i++)
            TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock][i]);

        for(new i; i < 4; i++)
            TextDrawsd[playerid][i] = TextDrawCreate(555.0, 402.0, "~b~.");

    }
    else
    for(new i; i < 4; i++)
    TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
    for(new i; i < 15; i++)
    new string[256];
    new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
    new vehicle = GetPlayerVehicleID(playerid);
    {
    if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
        SetTimerEx("engine2", 2500, false, "ii", playerid);
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
        SetTimerEx("engine2", 2500, false, "ii", playerid);
    }
}
Errors are :

Код:
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(6212) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(6212) : error 017: undefined symbol "string"
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(6212) : warning 215: expression has no effect
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(6212) : error 001: expected token: ";", but found "]"
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(6212) : fatal error 107: too many error messages on one line

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


4 Errors.



Re: Errors - Devine - 28.02.2010

pawn Код:
new string[128];
at the top of the function.