Admin Gametext - 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: Admin Gametext (
/showthread.php?tid=250844)
Admin Gametext -
Admigo - 24.04.2011
Heey Scripters
I want to make a command sort of announce but then you dont need to fill timer and style!
Example: /(command) (text) //not the ()
Thanks admigo
Re: Admin Gametext -
Seven_of_Nine - 24.04.2011
I have one in my Admin FS (download in signature)
pawn Код:
//sscanf+zcmd /announce by Seven_of_Nine
COMMAND:announce(playerid,params[]) {
new
poster[40],
mess[128];
if(PlayerInfo[playerid][pAdminLevel] >= 3) {
if(sscanf(params,"s",mess))
return SendClientMessage(playerid,red,"USAGE: /announce [message]");
if(!isnull(mess)) {
new text[128];
GetPlayerName(playerid,poster,sizeof(poster));
format(text,sizeof(text),"[Announce] | Administrator \"%s\" has announced his message. (%s)",poster,mess);
SendClientMessageToAll(COLOR_LIGHTBLUE,text);
GameTextForAll(mess,5000,3);
} else {
return SendClientMessage(playerid,red,"USAGE: /announce [message], and all players will see this message on-screen.");
}
} else {
return SendClientMessage(playerid,red,"Only lvl3 admins can use this command. Looking for a way to announce? Try /message!");
}
return 1;
}
:]
Re: Admin Gametext -
Admigo - 24.04.2011
I have announce to but i dont want to fill in style and timmer every time!
Re: Admin Gametext -
Seven_of_Nine - 24.04.2011
It doesn't need to. This a version like /announce [message]. Test it for yourself. It's working.
Re: Admin Gametext -
xir - 24.04.2011
Really long code & Messy code Seven
A shorter & better
pawn Код:
COMMAND:command(playerid, params[])
{
new string[128], pName[MAX_PLAYER_NAME];
if(sscanf(params,"s[128]", params)) return SendClientMessage(playerid, -1, "Usage: /command <text>");
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof string, "Adminstrator %s: %s", pName params);
SendClientMessageToAll(-1, string);
return 1;
}
He says he doesn't want in style & the timing, I think he means just normal chat
Re: Admin Gametext -
Admigo - 24.04.2011
Quote:
Originally Posted by xir
Really long code & Messy code Seven
A shorter & better
pawn Код:
COMMAND:command(playerid, params[]) { new string[128], pName[MAX_PLAYER_NAME]; if(sscanf(params,"s[128]", params)) return SendClientMessage(playerid, -1, "Usage: /command <text>"); GetPlayerName(playerid,pName,sizeof(pName)); format(string, sizeof string, "Adminstrator %s: %s", pName params); SendClientMessageToAll(-1, string); return 1; }
He says he doesn't want in style & the timing, I think he means just normal chat
|
How can i put this command in GM Because i use if (strcmp("/command", cmdtext, true, 10) == 0) this.
Re: Admin Gametext -
xir - 24.04.2011
that willl require strtok & I can't simply figure that out, sorry, only sscanf
You should consider switching all your current strmcp cmds to zcmd & sscanf.
Strtok & strcmp is old shit & outdated.
Re: Admin Gametext -
Admigo - 24.04.2011
Quote:
Originally Posted by xir
that willl require strtok & I can't simply figure that out, sorry, only sscanf
You should consider switching all your current strmcp cmds to zcmd & sscanf.
Strtok & strcmp is old shit & outdated.
|
Sorry i dont understand because i am beginner lol