HELP ME
#1

Guys help me
Eror:-
warning 219: local variable "playerid" shadows a variable at a preceding level


error code
Код:
public OnPlayerConnect(playerid)
{
        new playerid; //<==MAIN ERROR LINE	
	new name [MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
	GetPlayerName(playerid,name, sizeof(name));
	format(string, sizeof(string), "%s Has joined the server|_", name);
 	SendClientMessage(playerid, 0xB8860BAA , "Welcome to the stunt server by ahad aman");
	SendClientMessageToAll(COLOR_YELLOW, string);
	return 1;
}
Reply
#2

Код:
public OnPlayerConnect(playerid)
{
	new name[MAX_PLAYER_NAME], string[180];
	GetPlayerName(playerid,name, sizeof(name));
	format(string, sizeof(string), "%s Has joined the server|_", name);
 	SendClientMessage(playerid, 0xB8860BAA , "Welcome to the stunt server by ahad aman");
	SendClientMessageToAll(COLOR_YELLOW, string);
	return 1;
}
Reply
#3

Fix this please too.
Error:-
warning 235: public function lacks forward declaration (symbol "OneDialogResponse")

Код:

public OneDialogResponse(playerid, dialogid, response, listitem, inputext[]) // <== MAin error line
{
	new HP;
	if(response)
	{
	    switch(dialogid)
	    {
	        case 1:
	        {
	            switch(listitem)
	            {
	                case 0:
	                {
	                GivePlayerMoney(playerid, -4);
	                SetPlayerHealth(playerid,(HP+5));
	                GivePlayerMoney(playerid, -4);
	                }
	                case 1:
	                {
	                GivePlayerWeapon(playerid, 5, 100);
	                GivePlayerMoney(playerid, -10);
	                }
	                case 2:
	                {
	                SetPlayerSpecialAction(playerid, 20);
	                GivePlayerMoney(playerid, -3);
	                SetTimer("beer",25000,false, "i", playerid);
                 }
			  }

           }
        
        }
     return 1;
    }
  return 0;
}
]
Reply
#4

"OneDialogResponse" to"OnDialogResponse"
Reply
#5

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        switch(dialogid)
	{
	    case 1:
	    {
	        if(response)
	        {
			new Float:HP;
			GetPlayerHealth(playerid, HP);
	                switch(listitem)
	                {
	                    case 0:
	                    {
		                GivePlayerMoney(playerid, -4);
		                SetPlayerHealth(playerid, HP + 5);
		                GivePlayerMoney(playerid, -4);
	                    }
	                   case 1:
	                    {
		                GivePlayerWeapon(playerid, 5, 100);
		                GivePlayerMoney(playerid, -10);
	                    }
	                    case 2:
	                    {
		                SetPlayerSpecialAction(playerid, 20);
		                GivePlayerMoney(playerid, -3);
		                SetTimer("beer",25000,false, "i", playerid);
                            }
		        }

                }

            }
        }
	return 1;
}
Reply
#6

error 021: symbol already defined: "S@@_OnDialogResponse"
Reply
#7

Replace your OnDialogResponse with the one I gave and try again.
Reply
#8

remove the other "OnDialogResponse"
Reply
#9

warning 206: redundant test: constant expression is non-zero
error code
Quote:

public OnGameModeInit()
{
//Group
new //<== main eror
towname[16];
for (new i = 0; 1 != MAX_TOW_LEVELS; ++i)
{
format(towname, sizeof (towname), "TOW position %d+", i + 1);
Tow[i] = Group_Create("TOWING");
}

// Don't use these lines if it's a filterscript

return 1;


}

Reply
#10

Код:
public OnGameModeInit()
{
//Group
new towname[16];
for (new i = 0; i != MAX_TOW_LEVELS; ++i)
{
format(towname, sizeof (towname), "TOW position %d+", i + 1);
Tow[i] = Group_Create("TOWING");
}

// Don't use these lines if it's a filterscript

return 1;


}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)