How to create /asay [text] -
RiChArD_A - 29.03.2013
Hello, how can I create the command /asay [text] for this variable: if(PlayerInfo[playerid][AdminLevel] >= 1) (All lvls, form 1 to 5). Thanks
Re: How to create /asay [text] -
SilverKiller - 30.03.2013
Using ZCMD, sscanf :
pawn Код:
CMD:asay(playerid, params[])
{
new String[100];
if(PlayerInfo[playerid][AdminLevel] < 1)
return SendClientMessage(playerid, -1, "You need to be an Adminstrator to use this command!");
else if(sscanf(params, "s[100]", String))
return SendClientMessage(playerid, -1, "Usage: /asay <text>");
else
{
GameTextForAll(String, 4000, 3);
}
return 1;
}
This will create a gametext for the players saying what you typed.
Next time ask on
https://sampforum.blast.hk/showthread.php?tid=413556 please.
Respuesta: Re: How to create /asay [text] -
RiChArD_A - 30.03.2013
Quote:
Originally Posted by SilverKiller
Using ZCMD, sscanf :
pawn Код:
CMD:asay(playerid, params[]) { new String[100]; if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, -1, "You need to be an Adminstrator to use this command!"); else if(sscanf(params, "s[100]", String)) return SendClientMessage(playerid, -1, "Usage: /asay <text>"); else { GameTextForAll(String, 4000, 3); } return 1; }
This will create a gametext for the players saying what you typed.
Next time ask on https://sampforum.blast.hk/showthread.php?tid=413556 please.
|
humm ok I,ll try.
PD: DUDE!!! long time since the last time I heard from you. (I was banned
)
Re : How to create /asay [text] -
thegreathom - 30.03.2013
pawn Код:
COMMAND:asay(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][AdminLevel] >= 1)
{
new text[128];
if(sscanf(params, "s[128]", text))
{
SendClientMessage(playerid,RED,"Usage: /asay <message>");
return 1;
}
new string[128];
format(string, sizeof(string), "* Admin %s: %s", GetName(playerid), text);
SendClientMessageToAll(RED,string);
}
else
{
SendClientMessage(playerid, RED,"You can't use this commands!");
}
return 1;
} // If you want it but with SendClientMessage
Respuesta: Re : How to create /asay [text] -
RiChArD_A - 30.03.2013
Quote:
Originally Posted by thegreathom
pawn Код:
COMMAND:asay(playerid,params[]) { #pragma unused params if(PlayerInfo[playerid][AdminLevel] >= 1) { new text[128]; if(sscanf(params, "s[128]", text)) { SendClientMessage(playerid,RED,"Usage: /asay <message>"); return 1; } new string[128]; format(string, sizeof(string), "* Admin %s: %s", GetName(playerid), text); SendClientMessageToAll(RED,string); } else { SendClientMessage(playerid, RED,"You can't use this commands!"); } return 1; } // If you want it but with SendClientMessage
|
look:
Код:
pwn(1542) : error 017: undefined symbol "GetName"
Re: Respuesta: Re : How to create /asay [text] -
SilverKiller - 30.03.2013
Quote:
Originally Posted by Lauder
look:
Код:
pwn(1542) : error 017: undefined symbol "GetName"
|
pawn Код:
CMD:asay(playerid, params[])
{
new String[100];
if(PlayerInfo[playerid][AdminLevel] < 1)
return SendClientMessage(playerid, -1, "You need to be an Adminstrator to use this command!");
else if(sscanf(params, "s[100]", String))
return SendClientMessage(playerid, -1, "Usage: /asay <text>");
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(String, 100, "Adminstrator %s : %s", pName, String);
SendClientMessageToAll(-1, String);
}
return 1;
}
Should work
Re: How to create /asay [text] -
Konstantinos - 30.03.2013
Why not just
pawn Код:
CMD:asay(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /asay <text>");
new
text[ 128 ]
;
format(text, 128, "ADMIN: %s", params);
SendClientMessageToAll(-1, text);
return 1;
}
?
Respuesta: Re: Respuesta: Re : How to create /asay [text] -
RiChArD_A - 30.03.2013
Quote:
Originally Posted by SilverKiller
pawn Код:
CMD:asay(playerid, params[]) { new String[100]; if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, -1, "You need to be an Adminstrator to use this command!"); else if(sscanf(params, "s[100]", String)) return SendClientMessage(playerid, -1, "Usage: /asay <text>"); else { new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME); format(String, 100, "Adminstrator %s : %s", pName, String); SendClientMessageToAll(-1, String); } return 1; }
Should work
|
Thank you bro! hoo and... when you finish the Admin system that you are making, I want to be the first one to have it!
PD: And i'm also making one.
.
|\/| |\/| |\/|... soooooo.... are you going to help me with that admin system that I asked you to install?