SA-MP Forums Archive
HELP ME - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP ME (/showthread.php?tid=585718)



HELP ME - Trollerz - 16.08.2015

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;
}



Re: HELP ME - UnDetectable - 16.08.2015

Код:
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;
}



Re: HELP ME - Trollerz - 16.08.2015

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;
}
]


Re: HELP ME - Variable™ - 16.08.2015

"OneDialogResponse" to"OnDialogResponse"


Re: HELP ME - UnDetectable - 16.08.2015

Код:
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;
}



Re: HELP ME - Trollerz - 16.08.2015

error 021: symbol already defined: "S@@_OnDialogResponse"


Re: HELP ME - UnDetectable - 16.08.2015

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


Re: HELP ME - Variable™ - 16.08.2015

remove the other "OnDialogResponse"


Re: HELP ME - Trollerz - 16.08.2015

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;


}




Re: HELP ME - Variable™ - 16.08.2015

Код:
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;


}