26 Errors with Array
#1

pawn Код:
CMD:engine(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid, string[128];
        vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_ON)
        {
            SetVehicleEngine(vehicleid, playerid);
        }
        else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            if(Fuel[vehicleid] < 1.0)
            {
                SendClientMessageEx(playerid, COLOR_GRAD2, " Your vehicle is out of fuel, it won't start!");
            }
            else
            {
                foreach(Player, i)
                {
                    for(new d=0; d<MAX_PLAYERVEHICLES; d++)
                    {
                        if(PlayerVehicleInfo[i][d][pvId] == vehicleid)
                        {
                            if(i == playerid)
                            else if(i == PlayerInfo[playerid][pVehicleKeysFrom])
                            {
                                if(!IsABike(vehicleid))
                                {
                                    SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
                                    SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
                                    format(string, sizeof(string), "* %s twists the key in the ignition, turning the engine on.", GetPlayerNameEx(playerid));
                                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    return 1;
        }
                                else
                                {
                                    SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
                                    SetTimerEx("SetVehicleEngine", 700, 0, "dd",  vehicleid, playerid);
                                    format(string, sizeof(string), "* %s flips the killswitch to the on position and depresses the ignition switch, turning the engine on.", GetPlayerNameEx(playerid));
                                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    return 1;
                                }
                            }
                            else
                            {
                                if(PlayerInfo[playerid][pHasCarJack] == 1)
                                {
                                    if(PlayerInfo[playerid][pJackingCar] == 1)
                                    {
                                        SendClientMessageEx(playerid, COLOR_GRAD2, "  You are already attempting to jack the car, please wait!");
                                        return 1;
                                    }
                                    else
                                    {
                                        format(string, sizeof(string), "* %s takes out a set of tools and attempts to wire the ignition.", GetPlayerNameEx(playerid));
                                        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

                                        SendClientMessageEx(playerid, COLOR_WHITE, "Attempting to wire the ignition...");
                                        GameTextForPlayer(playerid, "~r~Attempting to wire the ignition...", 10000, 3);

                                        SetTimerEx("WireIgnition", 10000, 0, "id", playerid, vehicleid);

                                        PlayerInfo[playerid][pJackingCar] =1;

                                        PlayerInfo[playerid][pJackAttempts] --;
                                        if(PlayerInfo[playerid][pJackAttempts] == 0)
                                        {
                                            PlayerInfo[playerid][pHasCarJack] =0;
                                            SendClientMessageEx(playerid, COLOR_WHITE, "This is your last attempt, the tool kit has worn down...");
                                        }
                                        return 1;
                                    }
                                }
                                else
                                {
                                    SendClientMessageEx(playerid, COLOR_GRAD2, "  You do not have the keys for this vehicle / any car jacking items to start the ignition!");
                                }
                            }
                        }
                        return 1;
}
Код:
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(2848) : error 017: undefined symbol "FixHour"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6059) : error 017: undefined symbol "splits"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6341) : error 017: undefined symbol "ini_GetKey"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6341) : error 033: array must be indexed (variable "key")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6343) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6343) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6345) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6345) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6347) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6347) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6349) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6349) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6351) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6351) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6353) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6353) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6355) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6355) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6357) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6357) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6359) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6359) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6361) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6361) : error 033: array must be indexed (variable "val")
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6363) : error 017: undefined symbol "Ini_Value"
C:\Users\pc\Desktop\SGRP\gamemodes\VGRP.pwn(6363) : error 033: array must be indexed (variable "val")

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


26 Errors.
I don't know how to make array , can you correct this?? and Reply me the Fixed CMD:ENGINE
Reply
#2

PHP код:
CMD:engine(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
vehicleidstring[128];
        
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON)
        {
            
SetVehicleEngine(vehicleidplayerid);
        }
        else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            if(
Fuel[vehicleid] < 1.0)
            {
                
SendClientMessageEx(playeridCOLOR_GRAD2" Your vehicle is out of fuel, it won't start!");
            }
            else
            {
                    for(new 
d=0d<MAX_PLAYERVEHICLESd++)
                    {
                        if(
PlayerVehicleInfo[i][d][pvId] == vehicleid)
                        {
                            if(
== playerid)
                            {
                                else if(
== PlayerInfo[playerid][pVehicleKeysFrom])
                                {
                                    if(!
IsABike(vehicleid))
                                    {
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
                                        
SetTimerEx("SetVehicleEngine"10000"dd",  vehicleidplayerid);
                                        
format(stringsizeof(string), "* %s twists the key in the ignition, turning the engine on."GetPlayerNameEx(playerid));
                                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        return 
1;
                                    }
                                    else
                                    {
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
                                        
SetTimerEx("SetVehicleEngine"7000"dd",  vehicleidplayerid);
                                        
format(stringsizeof(string), "* %s flips the killswitch to the on position and depresses the ignition switch, turning the engine on."GetPlayerNameEx(playerid));
                                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        return 
1;
                                    }
                                }
                            }
                            else
                            {
                                if(
PlayerInfo[playerid][pHasCarJack] == 1)
                                {
                                    if(
PlayerInfo[playerid][pJackingCar] == 1)
                                    {
                                        
SendClientMessageEx(playeridCOLOR_GRAD2"  You are already attempting to jack the car, please wait!");
                                        return 
1;
                                    }
                                    else
                                    {
                                        
format(stringsizeof(string), "* %s takes out a set of tools and attempts to wire the ignition."GetPlayerNameEx(playerid));
                                        
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Attempting to wire the ignition...");
                                        
GameTextForPlayer(playerid"~r~Attempting to wire the ignition..."100003);
                                        
SetTimerEx("WireIgnition"100000"id"playeridvehicleid);
                                        
PlayerInfo[playerid][pJackingCar] =1;
                                        
PlayerInfo[playerid][pJackAttempts] --;
                                        if(
PlayerInfo[playerid][pJackAttempts] == 0)
                                        {
                                            
PlayerInfo[playerid][pHasCarJack] =0;
                                            
SendClientMessageEx(playeridCOLOR_WHITE"This is your last attempt, the tool kit has worn down...");
                                        }
                                        return 
1;
                                    }
                                }
                                else
                                {
                                    
SendClientMessageEx(playeridCOLOR_GRAD2"  You do not have the keys for this vehicle / any car jacking items to start the ignition!");
                                }
                            }
                        }
                    }
                }
            }
        }
          return 
1;
  } 
Reply
#3

Код:
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35510) : error 017: undefined symbol "i"
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35512) : error 017: undefined symbol "i"
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35514) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35514) : warning 215: expression has no effect
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35514) : error 001: expected token: ";", but found "if"
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35514) : error 017: undefined symbol "i"
C:\Users\pc\Desktop\Test\gamemodes\VGRP.pwn(35514) : fatal error 107: too many error messages on one line

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


6 Errors.
Now i got this
Reply
#4

try this

PHP код:
CMD:engine(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
vehicleidstring[128];
        
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON)
        {
            
SetVehicleEngine(vehicleidplayerid);
        }
        else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            if(
Fuel[vehicleid] < 1.0)
            {
                
SendClientMessageEx(playeridCOLOR_GRAD2" Your vehicle is out of fuel, it won't start!");
            }
            else
            {
                    for(new 
i=0d<MAX_PLAYERVEHICLESi++)
                    {
                        if(
PlayerVehicleInfo[i][d][pvId] == vehicleid)
                        {
                            if(
== playerid)
                            {
                                else if(
== PlayerInfo[playerid][pVehicleKeysFrom])
                                {
                                    if(!
IsABike(vehicleid))
                                    {
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
                                        
SetTimerEx("SetVehicleEngine"10000"dd",  vehicleidplayerid);
                                        
format(stringsizeof(string), "* %s twists the key in the ignition, turning the engine on."GetPlayerNameEx(playerid));
                                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        return 
1;
                                    }
                                    else
                                    {
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
                                        
SetTimerEx("SetVehicleEngine"7000"dd",  vehicleidplayerid);
                                        
format(stringsizeof(string), "* %s flips the killswitch to the on position and depresses the ignition switch, turning the engine on."GetPlayerNameEx(playerid));
                                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        return 
1;
                                    }
                                }
                            }
                            else if(
!= playerid)
                            {
                                if(
PlayerInfo[playerid][pHasCarJack] == 1)
                                {
                                    if(
PlayerInfo[playerid][pJackingCar] == 1)
                                    {
                                        
SendClientMessageEx(playeridCOLOR_GRAD2"  You are already attempting to jack the car, please wait!");
                                        return 
1;
                                    }
                                    else
                                    {
                                        
format(stringsizeof(string), "* %s takes out a set of tools and attempts to wire the ignition."GetPlayerNameEx(playerid));
                                        
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Attempting to wire the ignition...");
                                        
GameTextForPlayer(playerid"~r~Attempting to wire the ignition..."100003);
                                        
SetTimerEx("WireIgnition"100000"id"playeridvehicleid);
                                        
PlayerInfo[playerid][pJackingCar] =1;
                                        
PlayerInfo[playerid][pJackAttempts] --;
                                        if(
PlayerInfo[playerid][pJackAttempts] == 0)
                                        {
                                            
PlayerInfo[playerid][pHasCarJack] =0;
                                            
SendClientMessageEx(playeridCOLOR_WHITE"This is your last attempt, the tool kit has worn down...");
                                        }
                                        return 
1;
                                    }
                                }
                                else
                                {
                                    
SendClientMessageEx(playeridCOLOR_GRAD2"  You do not have the keys for this vehicle / any car jacking items to start the ignition!");
                                }
                            }
                        }
                    }
                }
            }
        }
          return 
1;
  } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)