Array must be indexed - for variable
#1

These are errors:

Код:
(33989) : error 033: array must be indexed (variable "szParameters")
(34004) : error 033: array must be indexed (variable "szParameters")
(34025) : error 033: array must be indexed (variable "szSetting")
(34026) : error 035: argument type mismatch (argument 1)
Command in which are errors:

Код:
CMD:bomb(playerid, params[])
{
	new
		idx,
		szParameters[2][128 - 6];

	szParameters[0] = strtok(params, idx); // ERROR - line 33989

	if(isnull(szParameters[0]))
	{
		SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb [Parameter]");
		SendClientMessage(playerid, COLOR_GREY, "Available parameters: {E6E6E6}put{AFAFAF}, {E6E6E6}activate{AFAFAF}");

        if(PlayerData[playerid][pSwatMember])
		{
			SendClientMessage(playerid, COLOR_FACTIONCHAT, "[SWAT]: {E6E6E6}check{AFAFAF}, {E6E6E6}disarm{AFAFAF}");
		}

		return 1;
	}

	szParameters[1] = strtok(params, idx); // ERROR - line 34004

	if(!strcmp(szParameters[0], "put", true, 4))
	{
		new
			BombTimerID = GetPVarInt(playerid, "PuttingBomb"),
			szSetting[20],
			iTimer;

		if(BombTimerID)
		{
			KillTimer(BombTimerID);
			DeletePVar(playerid, "PuttingBomb");
			GameTextForPlayer(playerid, "~r~Stopped arming bomb", 2000, 3);
			TogglePlayerControllable(playerid, 1);
			return 1;
		}

		if (!Inventory_HasItem(playerid, "Bomb"))
    		return SendErrorMessage(playerid, "You dont have a Bomb. Visit the blackmaret and buy one or contact an illegal member.");

		szSetting = strtok(params, idx); // ERROR - line 34025
		iTimer = strval(strtok(params, idx)); // ERROR - line 34026

		if(isnull(szParameters[1]))
		{
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb put [{E6E6E6}Vehicle ID{AFAFAF}] [{E6E6E6}Setting{AFAFAF}] [{E6E6E6}Timer (Seconds){AFAFAF}]");
			SendClientMessage(playerid, COLOR_WHITE, "Available settings: {E6E6E6}Ignition, timer, speed, remote"),
			SendClientMessage(playerid, COLOR_GREY, "NOTE: Use \"{E6E6E6}/bomb put help{AFAFAF}\" for explinations of use.");
			return 1;
		}

		if(!strcmp(szParameters[1], "help", true, 5))
		{
			SendClientMessage(playerid, COLOR_WHITE, "[ BOMB PUT MANUAL ]");
			SendClientMessage(playerid, COLOR_WHITE, "Setting 1: IGNITION {AAAAAA}- Activates the bomb timer after the {E6E6E6}vehicle's ignition{AAAAAA} is activated.");
			SendClientMessage(playerid, COLOR_WHITE, "Setting 2: TIMER {AAAAAA}- {E6E6E6}Immediately{AAAAAA} activates the bomb timer.");
			SendClientMessage(playerid, COLOR_WHITE, "Setting 3: SPEED {AAAAAA}- The bomb will explode as soon as the {E6E6E6}vehicle speed{AAAAAA}");
			SendClientMessage(playerid, COLOR_WHITE, "drops under {E6E6E6}40{AAAAAA} km/h. It is activated {E6E6E6}as soon as the vehicle is started{AAAAAA}.");
			SendClientMessage(playerid, COLOR_WHITE, "Setting 4: REMOTE {AAAAAA}- Bomb is activated with \"{E6E6E6}/bomb activate{AAAAAA}\". Note that the {E6E6E6}remote range is limited{AAAAAA}.");
			SendClientMessage(playerid, COLOR_WHITE, "The timer: {AAAAAA}- Decides how long it takes for the bomb to {E6E6E6}detonate{AAAAAA} from the moment it is activated.");
			SendClientMessage(playerid, COLOR_WHITE, "You can get the {E6E6E6}ID{AAAAAA} of the vehicle by using the \"{E6E6E6}/dl{AAAAAA}\" command.");
			SendClientMessage(playerid, COLOR_WHITE, "[ END OF BOMB PUT MANUAL ]");
			return 1;
		}

		if( !GetVehicleModel( strval( szParameters[1] ) ) ) // The car isn't spawned
		{
			SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
			SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
			return 1;
		}

		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to stand close to the vehicle, not in it.");
			return 1;
		}

		new
					iVehicleID = strval(szParameters[1]),
			Float: 	f_Pos[3];

		GetVehiclePos(iVehicleID, f_Pos[0], f_Pos[1], f_Pos[2]);

		if(!IsPlayerInRangeOfPoint(playerid, BOMB_USE_DISTANCE, f_Pos[0], f_Pos[1], f_Pos[2]))
		{
			SendClientMessage(playerid, COLOR_GREY, "ERROR: You are not close enough to this vehicle.");
			return 1;
		}

		new
			iSetting;

		if(!strcmp(szSetting, "ignition", true, 9))
		{
			if(iTimer < 1 || iTimer > 60)
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}1{AFAFAF} and {E6E6E6}60{AFAFAF} seconds.");
				return 1;
			}
			iSetting = VEHICLE_BOMB_TYPE_IGNITION;
			Inventory_Remove(playerid, "Bomb");
		}

		else if(!strcmp(szSetting, "timer", true, 6))
		{
			if(iTimer < 10 || iTimer > 120)
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}10{AFAFAF} and {E6E6E6}120{AFAFAF} seconds.");
				return 1;
			}
			iSetting = VEHICLE_BOMB_TYPE_TIMER;
			Inventory_Remove(playerid, "Bomb");
		}

		else if(!strcmp(szSetting, "speed", true, 6))
		{
			if(iTimer < 15 || iTimer > 60)
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}15{AFAFAF} and {E6E6E6}60{AFAFAF} seconds.");
				return 1;
			}
			iSetting = VEHICLE_BOMB_TYPE_SPEED;
			Inventory_Remove(playerid, "Bomb");
		}

		else if(!strcmp(szSetting, "remote", true, 6))
		{
			if(iTimer < 1 || iTimer > 60)
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}1{AFAFAF} and {E6E6E6}60{AFAFAF} seconds.");
				return 1;
			}
			iSetting = VEHICLE_BOMB_TYPE_REMOTE;
			Inventory_Remove(playerid, "Bomb");
		}

		else
		{
			SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid setting. Please refer to manual: \"{E6E6E6}/bomb put help{AFAFAF}\".");
			return 1;
		}

		ResetBombInfo(iVehicleID);

		ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 2.0, 0, 0, 0, 0, BOMB_ARMTIME * 1100, 0);

		SetPVarInt(playerid, "PuttingBomb", SetTimerEx("PlayerPutBombInVehicle", 0, 0, "ddddd", BOMB_ARMTIME, playerid, iVehicleID, iSetting, iTimer));

		return 1;

	}

	if(!strcmp(szParameters[0], "activate", true, 4))
	{
		new
			Float: 	f_vPos[3],
					iHasAnyRemoteBombs;

		for(new i; i < MAX_VEHICLES; i++)
		{
			if(g_Bomb_Vehicles[i][bv_i_ArmedType] == VEHICLE_BOMB_TYPE_REMOTE && g_Bomb_Vehicles[i][bv_i_BombOwner] == playerid)
			{
				iHasAnyRemoteBombs = 1;
				GetVehiclePos(i, f_vPos[0], f_vPos[1], f_vPos[2]);
				if(IsPlayerInRangeOfPoint(playerid, 100.0, f_vPos[0], f_vPos[1], f_vPos[2]))
				{
					g_Bomb_Vehicles[i][bv_i_BombOwner] = INVALID_PLAYER_ID;
					BombActivated(i);
				}
			}
		}

		if(!iHasAnyRemoteBombs)
		{
			SendClientMessage(playerid, COLOR_GREY, "ERROR: You haven't planted any bombs.");
			return 1;
		}

		new
			Float:	f_Pos[3];

		GetPlayerPos(playerid, f_Pos[0], f_Pos[1], f_Pos[2]);

		PlayerPlaySound(playerid, 6400, f_Pos[0], f_Pos[1], f_Pos[2]);

		SendClientMessage(playerid, COLOR_ORANGE, "You pressed the trigger on your remote to active your bomb(s).");
		SendClientMessage(playerid, COLOR_GREY, "NOTE: The distance for the remote is limited.");

		return 1;
	}

	if(PlayerData[playerid][pSwatMember])
	{
		if(!strcmp(szParameters[0], "check", true, 4))
		{
			new
				BombCheckingTimerID = GetPVarInt(playerid, "CheckingForBombs");

			if(BombCheckingTimerID)
			{
				KillTimer(BombCheckingTimerID);
				DeletePVar(playerid, "CheckingForBombs");
				GameTextForPlayer(playerid, "~r~Stopped looking for bombs", 2000, 3);
				return 1;
			}

			if(GetPVarInt(playerid, "DisarmingBomb"))
			{
				SendClientMessage(playerid, COLOR_GREY, "You are busy disarming the bomb.");
				return 1;
			}

			if(isnull(szParameters[1]))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb check [Vehicle ID]");
				return 1;
			}

			new
				iVehicleID = strval(szParameters[1]);

			if(!GetVehicleModel(iVehicleID))
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
				SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
				return 1;
			}

			if(IsPlayerInAnyVehicle(playerid))
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to stand close to the vehicle, not in it.");
				return 1;
			}

			new
				Float: f_vPos[3];

			GetVehiclePos(iVehicleID, f_vPos[0], f_vPos[1], f_vPos[2]);

			if(!IsPlayerInRangeOfPoint(playerid, BOMB_USE_DISTANCE, f_vPos[0], f_vPos[1], f_vPos[2]))
			{
				SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the vehicle.");
				return 1;
			}

			GameTextForPlayer(playerid, "~g~Checking for bombs... ~n~ ~y~Type ~r~/bomb check~y~ again to stop.", BOMB_CHECKTIME * 1100, 3);

			ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 2.0, 0, 0, 0, 0, BOMB_CHECKTIME * 1100, 0);

			SetPVarInt(playerid, "CheckingForBombs", SetTimerEx("CheckForBombs", BOMB_CHECKTIME * 1000, 0, "dd", playerid, iVehicleID));

			return 1;
		}

		if(!strcmp(szParameters[0], "disarm", true, 4))
		{
			new
				DisarmingBombTimerID = GetPVarInt(playerid, "DisarmingBomb");

			if(DisarmingBombTimerID)
			{
				KillTimer(DisarmingBombTimerID);
				DeletePVar(playerid, "DisarmingBomb");
				GameTextForPlayer(playerid, "~r~Stopped disarming the bomb", 2000, 3);
				return 1;
			}

			if(GetPVarInt(playerid, "CheckingForBombs"))
			{
				SendClientMessage(playerid, COLOR_GREY, "You are busy checking for bombs.");
				return 1;
			}

			if(isnull(szParameters[1]))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb disarm [Vehicle ID]");
				SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
				return 1;
			}

			new
				iVehicleID = strval(szParameters[1]);

			if(!GetVehicleModel(iVehicleID))
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
				SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
				return 1;
			}

			if(IsPlayerInAnyVehicle(playerid))
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to stand close to the vehicle, not in it.");
				return 1;
			}

			new
				Float: f_vPos[3];

			GetVehiclePos(iVehicleID, f_vPos[0], f_vPos[1], f_vPos[2]);

			if(!IsPlayerInRangeOfPoint(playerid, BOMB_USE_DISTANCE, f_vPos[0], f_vPos[1], f_vPos[2]))
			{
				SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the vehicle.");
				return 1;
			}

			if(GetPVarInt(playerid, "CheckedCarForBombs") != iVehicleID)
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: You haven't checked this car for bombs yet, you need to see where it is first.");
				return 1;
			}

			if(GetPVarInt(playerid, "FoundBombInCar") != iVehicleID)
			{
				SendClientMessage(playerid, COLOR_GREY, "ERROR: You haven't found any bombs on this vehicle.");
				return 1;
			}

			GameTextForPlayer(playerid, "~g~Disarming bomb...~n~ ~y~Type ~r~/bomb disarm~y~ again to stop.", BOMB_DISARMTIME * 1000, 3);

			ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 2.0, 0, 0, 0, 0, BOMB_DISARMTIME * 1100, 0);

			SetPVarInt(playerid, "DisarmingBomb", SetTimerEx("DisarmBomb", BOMB_DISARMTIME * 1000, 0, "dd", playerid, iVehicleID));

			return 1;
		}
	}

	SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid parameter. For a full list of available parameters, type \"/bomb\".");
	return 1;
}
Reply
#2

PHP код:
CMD:bomb(playerid, params[])
{
    new
        
idx;
    if(
isnull(params))
    {
        
SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb [Parameter]");
        
SendClientMessage(playerid, COLOR_GREY, "Available parameters: {E6E6E6}put{AFAFAF}, {E6E6E6}activate{AFAFAF}");
        if(
PlayerData[playerid][pSwatMember])
        {
            
SendClientMessage(playerid, COLOR_FACTIONCHAT, "[SWAT]: {E6E6E6}check{AFAFAF}, {E6E6E6}disarm{AFAFAF}");
        }
        return 
1;
    }
    if(!
strcmp(params, "put", true, 4))
    {
        new
            
BombTimerID = GetPVarInt(playerid, "PuttingBomb"),
            
szSetting[20],
            
iTimer
                
;
                if(
sscanf(params,"ssi[20]", "put",szSetting, iTimer) return  SendErrorMessage(playerid, "USAGE:/bomb [put] [setting] [timer]");
        if(
BombTimerID)
        {
            
KillTimer(BombTimerID);
            
DeletePVar(playerid, "PuttingBomb");
            
GameTextForPlayer(playerid, "~r~Stopped arming bomb", 2000, 3);
            
TogglePlayerControllable(playerid, 1);
            return 
1;
        }
        if (!
Inventory_HasItem(playerid, "Bomb"))
            return 
SendErrorMessage(playerid, "You dont have a Bomb. Visit the blackmaret and buy one or contact an illegal member.");
        if(
isnull(params))
        {
            
SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb put [{E6E6E6}Vehicle ID{AFAFAF}] [{E6E6E6}Setting{AFAFAF}] [{E6E6E6}Timer (Seconds){AFAFAF}]");
            
SendClientMessage(playerid, COLOR_WHITE, "Available settings: {E6E6E6}Ignition, timer, speed, remote"),
            
SendClientMessage(playerid, COLOR_GREY, "NOTE: Use \"{E6E6E6}/bomb put help{AFAFAF}\" for explinations of use.");
            return 
1;
        }
        if(!
strcmp(szParameters[1], "help", true, 5))
        {
            
SendClientMessage(playerid, COLOR_WHITE, "[ BOMB PUT MANUAL ]");
            
SendClientMessage(playerid, COLOR_WHITE, "Setting 1: IGNITION {AAAAAA}- Activates the bomb timer after the {E6E6E6}vehicle's ignition{AAAAAA} is activated.");
            
SendClientMessage(playerid, COLOR_WHITE, "Setting 2: TIMER {AAAAAA}- {E6E6E6}Immediately{AAAAAA} activates the bomb timer.");
            
SendClientMessage(playerid, COLOR_WHITE, "Setting 3: SPEED {AAAAAA}- The bomb will explode as soon as the {E6E6E6}vehicle speed{AAAAAA}");
            
SendClientMessage(playerid, COLOR_WHITE, "drops under {E6E6E6}40{AAAAAA} km/h. It is activated {E6E6E6}as soon as the vehicle is started{AAAAAA}.");
            
SendClientMessage(playerid, COLOR_WHITE, "Setting 4: REMOTE {AAAAAA}- Bomb is activated with \"{E6E6E6}/bomb activate{AAAAAA}\". Note that the {E6E6E6}remote range is limited{AAAAAA}.");
            
SendClientMessage(playerid, COLOR_WHITE, "The timer: {AAAAAA}- Decides how long it takes for the bomb to {E6E6E6}detonate{AAAAAA} from the moment it is activated.");
            
SendClientMessage(playerid, COLOR_WHITE, "You can get the {E6E6E6}ID{AAAAAA} of the vehicle by using the \"{E6E6E6}/dl{AAAAAA}\" command.");
            
SendClientMessage(playerid, COLOR_WHITE, "[ END OF BOMB PUT MANUAL ]");
            return 
1;
        }
        if( !
GetVehicleModel( strval( szParameters[1] ) ) ) // The car isn't spawned
        
{
            
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
            
SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
            return 
1;
        }
        if(
IsPlayerInAnyVehicle(playerid))
        {
            
SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to stand close to the vehicle, not in it.");
            return 
1;
        }
        new
                    
iVehicleID = strval(szParameters[1]),
            
Float:     f_Pos[3];
        
GetVehiclePos(iVehicleID, f_Pos[0], f_Pos[1], f_Pos[2]);
        if(!
IsPlayerInRangeOfPoint(playerid, BOMB_USE_DISTANCE, f_Pos[0], f_Pos[1], f_Pos[2]))
        {
            
SendClientMessage(playerid, COLOR_GREY, "ERROR: You are not close enough to this vehicle.");
            return 
1;
        }
        new
            
iSetting;
        if(!
strcmp(szSetting, "ignition", true, 9))
        {
            if(
iTimer < 1 || iTimer > 60)
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}1{AFAFAF} and {E6E6E6}60{AFAFAF} seconds.");
                return 
1;
            }
            
iSetting = VEHICLE_BOMB_TYPE_IGNITION;
            
Inventory_Remove(playerid, "Bomb");
        }
        else if(!
strcmp(szSetting, "timer", true, 6))
        {
            if(
iTimer < 10 || iTimer > 120)
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}10{AFAFAF} and {E6E6E6}120{AFAFAF} seconds.");
                return 
1;
            }
            
iSetting = VEHICLE_BOMB_TYPE_TIMER;
            
Inventory_Remove(playerid, "Bomb");
        }
        else if(!
strcmp(szSetting, "speed", true, 6))
        {
            if(
iTimer < 15 || iTimer > 60)
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}15{AFAFAF} and {E6E6E6}60{AFAFAF} seconds.");
                return 
1;
            }
            
iSetting = VEHICLE_BOMB_TYPE_SPEED;
            
Inventory_Remove(playerid, "Bomb");
        }
        else if(!
strcmp(szSetting, "remote", true, 6))
        {
            if(
iTimer < 1 || iTimer > 60)
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid timer input. Must be between {E6E6E6}1{AFAFAF} and {E6E6E6}60{AFAFAF} seconds.");
                return 
1;
            }
            
iSetting = VEHICLE_BOMB_TYPE_REMOTE;
            
Inventory_Remove(playerid, "Bomb");
        }
        else
        {
            
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid setting. Please refer to manual: \"{E6E6E6}/bomb put help{AFAFAF}\".");
            return 
1;
        }
        
ResetBombInfo(iVehicleID);
        
ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 2.0, 0, 0, 0, 0, BOMB_ARMTIME * 1100, 0);
        
SetPVarInt(playerid, "PuttingBomb", SetTimerEx("PlayerPutBombInVehicle", 0, 0, "ddddd", BOMB_ARMTIME, playerid, iVehicleID, iSetting, iTimer));
        return 
1;
    }
    if(!
strcmp(szParameters[0], "activate", true, 4))
    {
        new
            
Float:     f_vPos[3],
                    
iHasAnyRemoteBombs;
        for(new 
i; i < MAX_VEHICLES; i++)
        {
            if(
g_Bomb_Vehicles[i][bv_i_ArmedType] == VEHICLE_BOMB_TYPE_REMOTE && g_Bomb_Vehicles[i][bv_i_BombOwner] == playerid)
            {
                
iHasAnyRemoteBombs = 1;
                
GetVehiclePos(i, f_vPos[0], f_vPos[1], f_vPos[2]);
                if(
IsPlayerInRangeOfPoint(playerid, 100.0, f_vPos[0], f_vPos[1], f_vPos[2]))
                {
                    
g_Bomb_Vehicles[i][bv_i_BombOwner] = INVALID_PLAYER_ID;
                    
BombActivated(i);
                }
            }
        }
        if(!
iHasAnyRemoteBombs)
        {
            
SendClientMessage(playerid, COLOR_GREY, "ERROR: You haven't planted any bombs.");
            return 
1;
        }
        new
            
Float:    f_Pos[3];
        
GetPlayerPos(playerid, f_Pos[0], f_Pos[1], f_Pos[2]);
        
PlayerPlaySound(playerid, 6400, f_Pos[0], f_Pos[1], f_Pos[2]);
        
SendClientMessage(playerid, COLOR_ORANGE, "You pressed the trigger on your remote to active your bomb(s).");
        
SendClientMessage(playerid, COLOR_GREY, "NOTE: The distance for the remote is limited.");
        return 
1;
    }
    if(
PlayerData[playerid][pSwatMember])
    {
        if(!
strcmp(szParameters[0], "check", true, 4))
        {
            new
                
BombCheckingTimerID = GetPVarInt(playerid, "CheckingForBombs");
            if(
BombCheckingTimerID)
            {
                
KillTimer(BombCheckingTimerID);
                
DeletePVar(playerid, "CheckingForBombs");
                
GameTextForPlayer(playerid, "~r~Stopped looking for bombs", 2000, 3);
                return 
1;
            }
            if(
GetPVarInt(playerid, "DisarmingBomb"))
            {
                
SendClientMessage(playerid, COLOR_GREY, "You are busy disarming the bomb.");
                return 
1;
            }
            if(
isnull(szParameters[1]))
            {
                
SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb check [Vehicle ID]");
                return 
1;
            }
            new
                
iVehicleID = strval(szParameters[1]);
            if(!
GetVehicleModel(iVehicleID))
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
                
SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
                return 
1;
            }
            if(
IsPlayerInAnyVehicle(playerid))
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to stand close to the vehicle, not in it.");
                return 
1;
            }
            new
                
Float: f_vPos[3];
            
GetVehiclePos(iVehicleID, f_vPos[0], f_vPos[1], f_vPos[2]);
            if(!
IsPlayerInRangeOfPoint(playerid, BOMB_USE_DISTANCE, f_vPos[0], f_vPos[1], f_vPos[2]))
            {
                
SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the vehicle.");
                return 
1;
            }
            
GameTextForPlayer(playerid, "~g~Checking for bombs... ~n~ ~y~Type ~r~/bomb check~y~ again to stop.", BOMB_CHECKTIME * 1100, 3);
            
ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 2.0, 0, 0, 0, 0, BOMB_CHECKTIME * 1100, 0);
            
SetPVarInt(playerid, "CheckingForBombs", SetTimerEx("CheckForBombs", BOMB_CHECKTIME * 1000, 0, "dd", playerid, iVehicleID));
            return 
1;
        }
        if(!
strcmp(szParameters[0], "disarm", true, 4))
        {
            new
                
DisarmingBombTimerID = GetPVarInt(playerid, "DisarmingBomb");
            if(
DisarmingBombTimerID)
            {
                
KillTimer(DisarmingBombTimerID);
                
DeletePVar(playerid, "DisarmingBomb");
                
GameTextForPlayer(playerid, "~r~Stopped disarming the bomb", 2000, 3);
                return 
1;
            }
            if(
GetPVarInt(playerid, "CheckingForBombs"))
            {
                
SendClientMessage(playerid, COLOR_GREY, "You are busy checking for bombs.");
                return 
1;
            }
            if(
isnull(szParameters[1]))
            {
                
SendClientMessage(playerid, COLOR_GREY, "USAGE: /bomb disarm [Vehicle ID]");
                
SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
                return 
1;
            }
            new
                
iVehicleID = strval(szParameters[1]);
            if(!
GetVehicleModel(iVehicleID))
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
                
SendClientMessage(playerid, COLOR_GREY, "TIP: You can use \"{E6E6E6}/dl{AFAFAF}\" to see the IDs of nearby vehicles.");
                return 
1;
            }
            if(
IsPlayerInAnyVehicle(playerid))
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to stand close to the vehicle, not in it.");
                return 
1;
            }
            new
                
Float: f_vPos[3];
            
GetVehiclePos(iVehicleID, f_vPos[0], f_vPos[1], f_vPos[2]);
            if(!
IsPlayerInRangeOfPoint(playerid, BOMB_USE_DISTANCE, f_vPos[0], f_vPos[1], f_vPos[2]))
            {
                
SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the vehicle.");
                return 
1;
            }
            if(
GetPVarInt(playerid, "CheckedCarForBombs") != iVehicleID)
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: You haven't checked this car for bombs yet, you need to see where it is first.");
                return 
1;
            }
            if(
GetPVarInt(playerid, "FoundBombInCar") != iVehicleID)
            {
                
SendClientMessage(playerid, COLOR_GREY, "ERROR: You haven't found any bombs on this vehicle.");
                return 
1;
            }
            
GameTextForPlayer(playerid, "~g~Disarming bomb...~n~ ~y~Type ~r~/bomb disarm~y~ again to stop.", BOMB_DISARMTIME * 1000, 3);
            
ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 2.0, 0, 0, 0, 0, BOMB_DISARMTIME * 1100, 0);
            
SetPVarInt(playerid, "DisarmingBomb", SetTimerEx("DisarmBomb", BOMB_DISARMTIME * 1000, 0, "dd", playerid, iVehicleID));
            return 
1;
        }
    }
    
SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid parameter. For a full list of available parameters, type \"/bomb\".");
    return 
1;
} 
you need sscanf -> https://sampforum.blast.hk/showthread.php?tid=570927
Reply
#3

I replaced everything and trying to compile but same errors I get.
I downloaded sscanf from this link: https://github.com/maddinat0r/sscanf/releases
Tried with npc and nothing changes(same errors), tried with sscanf-2.8.2-win32.zip and also nothing changes.
Originally link is broken so I found this link...
Reply
#4

Also, please don't do things like this:
PHP код:
szParameters[2][128 - 6]; 
You could have written 122 instead
Reply
#5

What errors you got ?

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Also, please don't do things like this:
PHP код:
szParameters[2][128 - 6]; 
You could have written 122 instead
Marcel u didn't notice he use ZCMD and strval on same place ?

Please if you don't know how to fix just don't speak
Reply
#6

The same errors as I mentioned:
Код:
(33989) : error 033: array must be indexed (variable "szParameters")
(34004) : error 033: array must be indexed (variable "szParameters")
(34025) : error 033: array must be indexed (variable "szSetting")
(34026) : error 035: argument type mismatch (argument 1)
I use South Central RP gamemode http://forum.sa-mp.com/showthread.ph...=south+central
Just downloaded it, put everything in and get that errors.
Reply
#7

Quote:
Originally Posted by solutioon
Посмотреть сообщение
I replaced everything and trying to compile but same errors I get.
I downloaded sscanf from this link: https://github.com/maddinat0r/sscanf/releases
Tried with npc and nothing changes(same errors), tried with sscanf-2.8.2-win32.zip and also nothing changes.
Originally link is broken so I found this link...
Quote:
Originally Posted by solutioon
Посмотреть сообщение
The same errors as I mentioned:
Код:
(33989) : error 033: array must be indexed (variable "szParameters")
(34004) : error 033: array must be indexed (variable "szParameters")
(34025) : error 033: array must be indexed (variable "szSetting")
(34026) : error 035: argument type mismatch (argument 1)
I use South Central RP gamemode http://forum.sa-mp.com/showthread.ph...=south+central
Just downloaded it, put everything in and get that errors.
pm me the link of includes
Reply
#8

Quote:
Originally Posted by Yaa
Посмотреть сообщение
What errors you got ?



Marcel u didn't notice he use ZCMD and strval on same place ?

Please if you don't know how to fix just don't speak
Thought i should just mention the string size thing, i never that it is a fix, did i?
Reply
#9

Quote:
Originally Posted by Yaa
Посмотреть сообщение
What errors you got ?



Marcel u didn't notice he use ZCMD and strval on same place ?

Please if you don't know how to fix just don't speak
Fuck off please, there's nothing wrong with trying to help, been days we're just jokin with ya and you're just getting un on heads.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)