Help. - 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. (
/showthread.php?tid=361971)
Help. -
bodey3333 - 22.07.2012
Need an example for a command announcing all players on the server about it. (/announce "Message" Then it sends to all. Waiting for your help guys.) By strcmp/Scanf/ZCMD.
Re: Help. -
bodey3333 - 22.07.2012
And please. I want a tutorial to step the first step at Scanf/ZCMD commands with it. I should be clear not complicated. And thanks.
Re: Help. -
[IKS]Niko_Hs™ - 22.07.2012
With this command you can define the time and the type of gametext :
Код:
CMD:announce(playerid, params[]) {
new Announce[129], Time, Style;
if(sscanf(params, "s[129]dd", Announce, Time, Style)) return SendClientMessage(playerid, COLOR, "/Announce <Text> <Time> <Style>");
else
{
if(Style > 6 || Style < 0) return SendClientMessage(playerid, COLOR, "Style | 0 - 6");
if (Time > 20*1000) return SendClientMessage(playerid, COLOR, "[ERROR]: Cannot send ads longer than 20 seconds.");
if(Style == 2) return SendClientMessage(playerid, COLOR, "[ERROR]: Unable to use the style 2, this style is bugged.");
GameTextForAll(Announce, Time, Style );
}
return 1;
}
Instead if you want a simple command, for example /announce text :
Код:
CMD:announce(playerid, params[]) {
new Announce[129];
if(sscanf(params, "s[129]", Announce)) return SendClientMessage(playerid, COLOR, "/Announce <Text>");
else
{
GameTextForAll(Announce, 8000, 3 );
}
return 1;
}
Tutorial ZCMD + Sscanf :
https://sampforum.blast.hk/showthread.php?tid=244841,
https://sampforum.blast.hk/showthread.php?tid=300397
Re: Help. - Glint - 22.07.2012
Quote:
Originally Posted by bodey3333
And please. I want a tutorial to step the first step at Scanf/ZCMD commands with it. I should be clear not complicated. And thanks.
|
Why double post, when there is an edit button ?