Errors
#1

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)