#include <a_samp>
#include <zcmd>
#include <DubColors>
/*
There are multiple way's to use zcmd. I like using this way the most.*/
CMD:report(playerid, params[])
{
}
// BUT you can also use this:
COMMAND:report(playerid, params[])
{
}
new string[128];
CMD:report(playerid, params[])
{
new string[128];
}
if(!isnull(params))
CMD:report(playerid, params[])
{
new string[128];
if(!isnull(params))
}
SendClientMessage(playerid, COLOR_YELLOW, "Your report was sent to the Admin Teams:");
format(string, sizeof(string), "%s", params);
SendClientMessage(playerid, COLOR_YELLOW, string);
CMD:report(playerid, params[])
{
new string[128];
if(!isnull(params))
{
SendClientMessage(playerid, COLOR_YELLOW, "Your report was sent to the Admin Teams:");
format(string, sizeof(string), "%s", params);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
for(new i=0; i<MAX_PLAYERS; i++)
if(IsPlayerAdmin(playerid))
{
CMD:report(playerid, params[])
{
new string[128];
if(!isnull(params))
{
SendClientMessage(playerid, COLOR_YELLOW, "Your report was sent to the Admin Teams:");
format(string, sizeof(string), "%s", params);
SendClientMessage(playerid, COLOR_YELLOW, string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(playerid))
{
format(string, sizeof(string), "Report from %s[%d]: %s", PlayerName(playerid), playerid, params);
SendClientMessage(i, COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Report [Text]");
}
return 1;
CMD:report(playerid, params[])
{
new string[128];
if(!isnull(params))
{
SendClientMessage(playerid, COLOR_YELLOW, "Your report was sent to the Admin Teams:");
format(string, sizeof(string), "%s", params); // Proof to the reporter, that the command worked.
SendClientMessage(playerid, COLOR_YELLOW, string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(playerid))
{
format(string, sizeof(string), "Report from %s[%d]: %s", PlayerName(playerid), playerid, params);
SendClientMessage(i, COLOR_ORANGE, string); // Send's the format to the online Rcon'ly Logged in Admins.
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Report [Text]"); // Show's the player the Usage.
}
return 1;
}
stock PlayerName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
You don't need sscanf for one parameter. That's what isnull() is for.
|
CMD:report(playerid, params[])
{
new string[128], reason[128], reportid;
if(sscanf(params, "is", reportid, reason)) return SendClientMessage(playerid, COLOR_RED, "|- [Error] /report [id] [text] -|");
format(string, sizeof(string), "REPORT: Player %s(%d) has reported %s(%d) for: %s", GetName(playerid), playerid, GetName(reportid), reportid, reason);
SendMessageToAdmins(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "Your report has been sent to all online Administrators");
return 1;
}
EDIT: your wasting alot of code. this isnt even needed
Code:
for(new i=0; i<MAX_PLAYERS; i++) |
Not to hijack the thread, but look how easier it is to make a /report command:
pawn Code:
EDIT: Nevermind, I forgot I used a stock ¬_¬ |
You don't need sscanf for one parameter. That's what isnull() is for.
|