/ooc +rep for helping - 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: /ooc +rep for helping (
/showthread.php?tid=536998)
/ooc +rep for helping -
MrCallum - 13.09.2014
I really need an /o for my players and /toggleooc for my admins.
Can anyone help me with this, i have looked around and they are all MYSQL when i am NON-MYSQL.
Please help!
ZCMD i use and Y_INI!
Re: /ooc +rep for helping -
ReD_HunTeR - 13.09.2014
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
new ToggleOOC = 0;
CMD:ooc(playerid, params[])
{
new text[500], string[128];
if(ToggleOOC == 1)
{
if(sscanf(params, "s[500]", text)) return SendClientMessage(playerid, -1, "Syntax: /(o)oc [text]");
format(string, sizeof(string), "[OOC] Admin %s: %s",PlayerName(playerid),text);
SendClientMessageToAll(-1, string);
}
else if(ToggleOOC == 0)
{
new status[40];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "OOC Chat is Currently Disabled");
if(sscanf(params, "s[500]", text)) return SendClientMessage(playerid, -1, "Syntax: /(o)oc [text]");
if(IsPlayerAdmin(playerid)) { status = "Admin"; }
else if(!IsPlayerAdmin(playerid)) { status = "Player"; }
format(string, sizeof(string), "[OOC] %s %s: %s",status, PlayerName(playerid),text);
SendClientMessageToAll(-1, string);
}
return 1;
}
CMD:o(playerid, params[]) return cmd_ooc(playerid, params);
CMD:togooc(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You're not authorized to use this command");
if(ToggleOOC == 0)
{
ToggleOOC = 1;
SendClientMessageToAll(-1, "OOC Chat Enabled");
}
else if(ToggleOOC == 1)
{
ToggleOOC = 0;
SendClientMessageToAll(-1, "OOC Chat Disabled");
}
return 1;
}
stock PlayerName(playerid)
{
new CName[24];
GetPlayerName(playerid, CName, 24);
return CName;
}
Re: /ooc +rep for helping -
Stinged - 13.09.2014
BlackBomb, you're code is fucked up to be honest.
1) You can't enter 500 characters in the T (or F6) box.
2) SendClientMessage limit is 128, so why 500 text?
3) You can use params instead of zcmd.
Re: /ooc +rep for helping -
MrCallum - 13.09.2014
How do i put instead of Admin in front of everyones name the staff rank they are?