Jump to content
  • 0

pomoc OnPlayerText


Ryso

Dotaz

Spravil som si funkciu, ze ked hrac napise slovo cheat, tak mu to vypise spravu, "Našiel si cheatera? Nahlás ho adminom cez /report", samozrejme odosle aj tu jeho povodnu spravu..

 

public OnPlayerText(playerid,text[])
{
   for(new i = 0; i < MAX_PLAYERS; i++)
{
	if(strfind(text[i], "cheat", true) != -1)
	{
		new pName[24];
	   	GetPlayerName(playerid, pName, 24);
	   	SendClientMessageToAll(COLOR_WHITE, text[i]);
		SendClientMessage(playerid, COLOR_RED, "Našiel si cheatera? Nahlás ho adminom cez /report");
		return 0;
	}
}
return 1;
}

 

Lenze odo to odosle tu hracovu spravu bez jeho mena, odosle len ten text.

Da sa to nejak spravit, ze ta sprava bude odoslana aj s hracovym menom s prislusnou farbou hraca?

Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0

public OnPlayerText(playerid, text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
	if(strfind(text[i], "cheat", true) != -1)
     	{
		new string[128];
		new pName[24];
		GetPlayerName(playerid, pName, 24);
		format(string, sizeof(string),"Našiel si cheatera? ' %s ' Nahlás ho adminom cez /report",pName);
		SendClientMessageToAll(COLOR_WHITE,string);
        	return 0;
     	}
  }
return 1;
}

Skus

Link to comment
Share on other sites

  • 0

public OnPlayerText(playerid, text[])

{

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(strfind(text, "cheat", true) != -1)

{

new string[128];

new pName[24];

GetPlayerName(playerid, pName, 24);

format(string, sizeof(string),"Našiel si cheatera? ' %s ' Nahlás ho adminom cez /report",pName);

 

return SendClientMessageToAll(COLOR_WHITE,string);;

}

}

return 1;

}

 

ešte otázka, načo for ?

 

 

public OnPlayerText(playerid, text[])

{

if(strfind(text[playerid], "cheat", true) != -1){

new string[128];

new pName[24];

GetPlayerName(playerid, pName, 24);

format(string, sizeof(string),"Našiel si cheatera? ' %s ' Nahlás ho adminom cez /report",pName);

return SendClientMessageToAll(COLOR_WHITE,string);;

}

 

return 1;

}

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...