Jump to content
  • 0

pomoc Warning235 - OnGamemodeInit


Riko

Dotaz

Zdravím,
 
Mám problém s tímto.

 

#include <a_samp>

new Text:Info;

public OnGamemodeInit()
	{
		Info = TextDrawCreate(190, 120, "/HELP - VESKERE INFORMACE O SERVERU");
		TextDrawFont(Info, 2);
		TextDrawColor(Info, 0x247514FF);
		TextDrawSetProportional(Info, 1);
		TextDrawSetShadow(Info, 0);
		TextDrawSetOutline(Info, 1);
		TextDrawLetterSize(Info, 2, 4);
	}
	
public OnPlayerConnect(playerid)
	{
	    TextDrawShowForPlayer(playerid, Info);
	}
		
		

 
Před tímto jsem dělal tento script a bylo to bez problému.
 

#include <a_samp>

new Text:WebLogo1;
new Text:WebLogo2;
new Text:WebLogo3;
new Text:WebLogo4;

public OnGameModeInit()
	{
		WebLogo1 = TextDrawCreate(40.000000, 295.000000, "PARADISE");
		TextDrawBackgroundColor(WebLogo1, 255);
		TextDrawFont(WebLogo1, 2);
		TextDrawLetterSize(WebLogo1, 0.228, 1.9);
		TextDrawColor(WebLogo1, 0x00FF00FF);
		TextDrawSetOutline(WebLogo1, 0);
		TextDrawSetProportional(WebLogo1, 1);
		TextDrawSetSelectable(WebLogo1, 0);
		TextDrawSetShadow(WebLogo1, 0);
		/////////////////////////////////////////////////////////////////
		WebLogo2 = TextDrawCreate(86.300000, 295.000000, "WORLD");
		TextDrawBackgroundColor(WebLogo2, 255);
		TextDrawFont(WebLogo2, 2);
		TextDrawLetterSize(WebLogo2, 0.228, 1.9);
		TextDrawColor(WebLogo2, 0xFFFFFFFF);
		TextDrawSetOutline(WebLogo2, 0);
		TextDrawSetProportional(WebLogo2, 1);
		TextDrawSetSelectable(WebLogo2, 0);
		TextDrawSetShadow(WebLogo2, 0);
		////////////////////////////////////////////////////////////////
		WebLogo3 = TextDrawCreate(119.300000, 299.000000, "1.1");
		TextDrawBackgroundColor(WebLogo3, 255);
		TextDrawFont(WebLogo3, 2);
		TextDrawLetterSize(WebLogo3, 0.32, 1.3);
		TextDrawColor(WebLogo3, 0xFF0000FF);
		TextDrawSetOutline(WebLogo3, 0);
		TextDrawSetProportional(WebLogo3, 1);
		TextDrawSetSelectable(WebLogo3, 0);
		TextDrawSetShadow(WebLogo3, 0);
		///////////////////////////////////////////////////////////////
		WebLogo4 = TextDrawCreate(39.200000, 307.000000, "www.pw.mzf.cz");
		TextDrawBackgroundColor(WebLogo4, 255);
		TextDrawFont(WebLogo4, 1);
		TextDrawLetterSize(WebLogo4, 0.24, 1.2);
		TextDrawColor(WebLogo4, 0xFFFFFFFF);
		TextDrawSetProportional(WebLogo4, 1);
		TextDrawSetShadow(WebLogo4, 0);
	}

public OnPlayerCommandText(playerid, cmdtext[])
	{
	    if(strcmp("/showtext", cmdtext, true, 10) == 0)
	        {
	            TextDrawShowForPlayer(playerid, WebLogo1);
	            TextDrawShowForPlayer(playerid, WebLogo2);
	            TextDrawShowForPlayer(playerid, WebLogo3);
	            TextDrawShowForPlayer(playerid, WebLogo4);
	            return 1;
			}
		if(strcmp("/hidetext", cmdtext, true, 10) == 0)
		    {
		        TextDrawHideForPlayer(playerid, WebLogo1);
		        TextDrawHideForPlayer(playerid, WebLogo2);
		        TextDrawHideForPlayer(playerid, WebLogo3);
				return 1;
			}
		return 0;
	}
	

Je možné, že warning 235: public function lacks forward declaration (symbol "OnGamemodeInit") mohl způsobit public OnPlayerConnect přičemž u druhého fska (druhý kód) je OnPlayerCommandText?

Díky za Vaše rady :)

Link to comment
Share on other sites

7 odpovědí na tuto otázku

Recommended Posts

  • 0

 

přidej si někam mimo fce

forward OnGamemodeInit();

 

To ma taky napadlo, ale prečo keď je to v include a u druhého Fska neházel warning?

 

inak díky

Link to comment
Share on other sites

  • 0

tak tady Forward OnGamemodeInit není a chybu nehází, přičemž tu public OnGamemodeInit je 

#include <a_samp>

new Text:WebLogo1;
new Text:WebLogo2;
new Text:WebLogo3;
new Text:WebLogo4;

public OnGameModeInit()
	{
		WebLogo1 = TextDrawCreate(40.000000, 295.000000, "PARADISE");
		TextDrawBackgroundColor(WebLogo1, 255);
		TextDrawFont(WebLogo1, 2);
		TextDrawLetterSize(WebLogo1, 0.228, 1.9);
		TextDrawColor(WebLogo1, 0x00FF00FF);
		TextDrawSetOutline(WebLogo1, 0);
		TextDrawSetProportional(WebLogo1, 1);
		TextDrawSetSelectable(WebLogo1, 0);
		TextDrawSetShadow(WebLogo1, 0);
		/////////////////////////////////////////////////////////////////
		WebLogo2 = TextDrawCreate(86.300000, 295.000000, "WORLD");
		TextDrawBackgroundColor(WebLogo2, 255);
		TextDrawFont(WebLogo2, 2);
		TextDrawLetterSize(WebLogo2, 0.228, 1.9);
		TextDrawColor(WebLogo2, 0xFFFFFFFF);
		TextDrawSetOutline(WebLogo2, 0);
		TextDrawSetProportional(WebLogo2, 1);
		TextDrawSetSelectable(WebLogo2, 0);
		TextDrawSetShadow(WebLogo2, 0);
		////////////////////////////////////////////////////////////////
		WebLogo3 = TextDrawCreate(119.300000, 299.000000, "1.1");
		TextDrawBackgroundColor(WebLogo3, 255);
		TextDrawFont(WebLogo3, 2);
		TextDrawLetterSize(WebLogo3, 0.32, 1.3);
		TextDrawColor(WebLogo3, 0xFF0000FF);
		TextDrawSetOutline(WebLogo3, 0);
		TextDrawSetProportional(WebLogo3, 1);
		TextDrawSetSelectable(WebLogo3, 0);
		TextDrawSetShadow(WebLogo3, 0);
		///////////////////////////////////////////////////////////////
		WebLogo4 = TextDrawCreate(39.200000, 307.000000, "www.pw.mzf.cz");
		TextDrawBackgroundColor(WebLogo4, 255);
		TextDrawFont(WebLogo4, 1);
		TextDrawLetterSize(WebLogo4, 0.24, 1.2);
		TextDrawColor(WebLogo4, 0xFFFFFFFF);
		TextDrawSetProportional(WebLogo4, 1);
		TextDrawSetShadow(WebLogo4, 0);
	}

public OnPlayerCommandText(playerid, cmdtext[])
	{
	    if(strcmp("/showtext", cmdtext, true, 10) == 0)
	        {
	            TextDrawShowForPlayer(playerid, WebLogo1);
	            TextDrawShowForPlayer(playerid, WebLogo2);
	            TextDrawShowForPlayer(playerid, WebLogo3);
	            TextDrawShowForPlayer(playerid, WebLogo4);
	            return 1;
			}
		if(strcmp("/hidetext", cmdtext, true, 10) == 0)
		    {
		        TextDrawHideForPlayer(playerid, WebLogo1);
		        TextDrawHideForPlayer(playerid, WebLogo2);
		        TextDrawHideForPlayer(playerid, WebLogo3);
				return 1;
			}
		return 0;
	}
	

Tu je public OnGamemodeInit je a forward také není jako u prvního a warning hází, proč? Nejde mi o to chybu ipravit, ale zjistit příčinu.

 

#include <a_samp>

new Text:Info;

public OnGamemodeInit()
	{
		Info = TextDrawCreate(190, 120, "/HELP - VESKERE INFORMACE O SERVERU");
		TextDrawFont(Info, 2);
		TextDrawColor(Info, 0x247514FF);
		TextDrawSetProportional(Info, 1);
		TextDrawSetShadow(Info, 0);
		TextDrawSetOutline(Info, 1);
		TextDrawLetterSize(Info, 2, 4);
	}
	
public OnPlayerConnect(playerid)
	{
	    TextDrawShowForPlayer(playerid, Info);
	}
		
		
Link to comment
Share on other sites

  • 0

V první mojí odpovědi to naznačuju, jestli pořád na to nemůžeš přijít..

 

OnGameModeInit x OnGamemodeInit

 

OnGameModeInit je už forwardnuto v a_samp.inc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...