/admins and /me zcmd 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /admins and /me zcmd help (
/showthread.php?tid=243828)
/admins and /me zcmd help -
ricardo178 - 24.03.2011
Hey guys...
Can someone tell me how do i mmake a /admins cmd with zcmd?
My admin variable is: PlayerInfo[playerid][Adminlevel]
By the way, about the /me, i tryed but i only find it in strcmp and don't know make it myself coz i dont know how to get player text...
Thanks very much!
Re: /admins and /me zcmd help -
austin070 - 24.03.2011
Here is the /me:
pawn Код:
CMD:me(playerid, params[])
{
if(sscanf(params, "s[50]", str)== 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(str, sizeof(str), "* %s %s", PlayerName, params);
ProxDetector(45.0,playerid,str,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); //Change this to SendClientMessageToAll if you want it as a global me.
return 1;
}
Re: /admins and /me zcmd help -
grand.Theft.Otto - 24.03.2011
strcmp /me:
pawn Код:
if(strcmp(cmdtext, "/me", true, 3)==0) {
new pname1[24], string[256];
GetPlayerName(playerid, pname1, 24);
format(string, 256, "*%s (%d) %s", pname1, playerid, cmdtext[4]);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;
}
Re: /admins and /me zcmd help -
SchurmanCQC - 24.03.2011
Quote:
Originally Posted by austin070
Here is the /me:
pawn Код:
CMD:me(playerid, params[]) { if(sscanf(params, "s[50]", str)== 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]"); new PlayerName[24]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); format(str, sizeof(str), "* %s %s", PlayerName, params); ProxDetector(45.0,playerid,str,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); //Change this to SendClientMessageToAll if you want it as a global me. return 1; }
|
Your
should be
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
Re: /admins and /me zcmd help -
austin070 - 24.03.2011
Quote:
Originally Posted by Schurman
Your should be
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
|
Can work either way.
Re: /admins and /me zcmd help -
ricardo178 - 24.03.2011
Thanks austin...
And by the way, GrandTheftAuto, if i asked zcmd it is because i don't use strcmp... STRCMP i found on wiki...
Re: /admins and /me zcmd help -
Skylar Paul - 24.03.2011
pawn Код:
COMMAND:admins(playerid, params[])
{
new string[128];
SendClientMessage(playerid, COLOR, "[Online Administrators]:");
for(new i = 0; i < MAX_PLAYERS; i++) {
if(PlayerInfo[playerid][AdminLevel] >= 1) {
new player_Name[MAX_PLAYER_NAME];
GetPlayerName(i, player_Name, sizeof(player_Name));
format(string, sizeof(string), "[Level: %d] %s", PlayerInfo[i][AdminLevel], player_Name);
SendClientMessage(playerid, COLOR, string); //Don't forget to replace "COLOR" with a valid color
}
}
return 1;
}
Should work perfectly fine.