Taxi pops up too many errors
#1

Errors: It's shows to me a warning from every line in the mode, I can't post all of them, here is just 2 of them
Код:
D:\samp037_svr_R2-1-1_win32\pawno\include\y_amx.inc(435) : warning 219: local variable "idx" shadows a variable at a preceding level

D:\samp037_svr_R2-1-1_win32\gamemodes\UGRP.pwn(14750) : error 035: argument type mismatch (argument 2)

26 Errors.
Taxi Variables:
Код:
// Taxi
new OrderedTaxi[MAX_PLAYERS];
new AcceptedTaxi[MAX_PLAYERS];
/Service:

Код:
if(!strcmp(params, "taxi", true))
	{
		if(OrderedTaxi[playerid] == 0)
		{
	    	SendClientMessage(playerid, COLOR_GREY, "Thank you for calling a Taxi, we will send your request to the available drivers. \nThey hang up..");
			OrderedTaxi[playerid] = 1;
	    	foreach(Player, i)
   	 		{
	    	    if(IsATaxidriver(i))
	    	    {
					format(string,sizeof(string),"%s is looking for a taxi driver, /accept taxi [%d] to follow his request. ",RPN(playerid), playerid);
					SendClientMessage(i,COLOR_YELLOW,string);
	    	    }
	    	}
	    }
	    else
	    {
            SendClientMessage(playerid, COLOR_GREY, "You have already ordered a Taxi, be patient.");
	    }
	}
/accept: The /accept caused the bug, if I remove the taxi function, the errors disappear
Код:
else if(!strcmp(params, "taxi", true))
	{
	    new playerb;
	    if(sscanf(params, "params[4]", params, playerb)) return SendClientMessage(playerid, COLOR_GREY, "/accept taxi [ID]");
		if(AcceptedTaxi[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You have already accepted a taxi call.");
		if(!IsATaxidriver(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not a Taxi driver.");
		if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
		if(OrderedTaxi[playerb])
		{
			format(string, sizeof(string), "You have accepted %s's Taxi request, He is now marked on your radar", RPN(playerb));
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "Taxi Driver %s is now on his way to you", RPN(playerid));
			SendClientMessage(playerb, COLOR_YELLOW, string);
			CP[playerid] = 8779;
			AcceptedTaxi[playerid] = 1;
			new Float:PosX, Float:PosY, Float:PosZ;
			GetPlayerPos(playerb, PosX, PosY, PosZ);
			SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, 4.0);
			return 1;				}
		}
		else if(!OrderedTaxi[playerb])
		{
		    SendClientMessage(playerid, COLOR_GREY, "This player hasn't ordered a Taxi");
		    return 1;
		}
	}
Reply
#2

Hi!

PHP код:
D:\samp037_svr_R2-1-1_win32\pawno\include\y_amx.inc(435) : warning 219local variable "idx" shadows a variable at a preceding level 
This warning is in the include y_amx. In the row 435 you can change the variable name idx into idx2 or something else.

PHP код:
D:\samp037_svr_R2-1-1_win32\gamemodes\UGRP.pwn(14750) : error 035argument type mismatch (argument 2
This error is in the gamemode UGRP. Can you show us the lines (14750)?
Reply
#3

If a particular library (include) works for everyone else then the problem is obviously not with that library. Never meddle with libraries. Something is defined or included before y_amx which defines idx in the global scope.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
If a particular library (include) works for everyone else then the problem is obviously not with that library. Never meddle with libraries. Something is defined or included before y_amx which defines idx in the global scope.
Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hi!

PHP код:
D:\samp037_svr_R2-1-1_win32\pawno\include\y_amx.inc(435) : warning 219local variable "idx" shadows a variable at a preceding level 
This warning is in the include y_amx. In the row 435 you can change the variable name idx into idx2 or something else.

PHP код:
D:\samp037_svr_R2-1-1_win32\gamemodes\UGRP.pwn(14750) : error 035argument type mismatch (argument 2
This error is in the gamemode UGRP. Can you show us the lines (14750)?
You are right Vince.
If I remove the taxi function from /accept, all of the errors and warnings disappear
@Mencent, It's not only this error and the warning I stated, I receive warnings from 80 percent of my mode
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)