SA-MP Forums Archive
Need help with /adminsay. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with /adminsay. (/showthread.php?tid=124206)



Need help with /adminsay. - Mechscape - 29.01.2010



Код:
if(strcmp(cmd, "/adminsay", true) == 0)
	{
		if(IsPlayerAdmin(playerid))
		{
		  new result[256];
		  new pname[MAX_PLAYER_NAME], string5[256];
  		GetPlayerName(playerid, pname, sizeof(pname));
  		format(string5,sizeof(string5), "Administraator %s: %s", pname, result);
  		SendClientMessageToAll(VARV_VALGE, string5);
		}
		else
		{
			SendClientMessage(playerid, VARV_VALGE, "Sa ei ole RCON administraatorina!");
		}
	}



Re: Need help with /adminsay. - WackoX - 29.01.2010

Quote:
Originally Posted by Picharelo


Код:
if(strcmp(cmd, "/adminsay", true) == 0)
	{
		if(IsPlayerAdmin(playerid))
		{
		  new result[256];
		  new pname[MAX_PLAYER_NAME], string5[256];
  		GetPlayerName(playerid, pname, sizeof(pname));
  		format(string5,sizeof(string5), "Administraator %s: %s", pname, result);
  		SendClientMessageToAll(VARV_VALGE, string5);
		}
		else
		{
			SendClientMessage(playerid, VARV_VALGE, "Sa ei ole RCON administraatorina!");
		}
	}
Add:
Quote:

return 1;




Re: Need help with /adminsay. - LuxurioN™ - 29.01.2010

Try this (Not Tested):

pawn Код:
if(strcmp(cmd, "/adminsay", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
new idx,
result[128],
string5[128],
pname[MAX_PLAYER_NAME];

result = strtok(cmdtext, idx);
GetPlayerName(playerid, pname, sizeof(pname));
if(!strlen(result))
{
SendClientMessage(playerid, VARV_VALGE, "Use: /adminsay [message]");
return 1;
}
format(string5, sizeof(string5), "Administraator %s: %s",pname,result);
SendClientMessageToAll(VARV_VALGE, string5);
}
else SendClientMessage(playerid, VARV_VALGE, "Sa ei ole RCON administraatorina!");
return 1;
}



Re: Need help with /adminsay. - Mechscape - 29.01.2010

Thanks.