SA-MP Forums Archive
Need help with this cmd - 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: Need help with this cmd (/showthread.php?tid=597092)



Need help with this cmd - Leopards - 26.12.2015

when someone use report that this report everyone can see i want it to only see admins can someone fix this cmd i will give him repution

CMD:report(playerid, params[]) {
new id;
new reason[128];
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "[SERVER] - USAGE: /report [ID] [REASON]");
new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
GetPlayerName(id, receiver, sizeof(receiver));
format(string, sizeof(string), "[ADMIN] - %s(%d) has reported %s(%d)", sender, playerid, receiver, id);
SendMessageToAdmins(string);
format(string, sizeof(string), "[ADMIN] - Reason: %s", reason);
SendMessageToAdmins(string);
SendClientMessage(playerid, COLOR_ORANGE, "Your report has been sent.");
return 1;
}


Re: Need help with this cmd - KillerDVX - 26.12.2015

Show us your "SendMessageToAdmins" function.


Re: Need help with this cmd - xXRevolverXx - 26.12.2015

Show me the define or the enum, function whatever, which is tolerated with the administration system.


Re: Need help with this cmd - saffierr - 26.12.2015

in the SendMessageToAdmins function, it should Send a message to the online admins.


Re: Need help with this cmd - SaltySandy - 26.12.2015

Could you copy your function in here? We've got no clue what it is, and if the mistake is in there.


Re: Need help with this cmd - Leopards - 26.12.2015

here is
stock SendMessageToAdmins(message[])
{
new pCount;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if((Player[i][Level] >= 1) || !IsPlayerAdmin(i)) continue;
pCount++;
SendClientMessage(i, 0x00FF00AA, message);
}
CallLocalFunction("OnMessageToAdminsSent", "sd", message, pCount); //<-- !!!
return 1;
}


Re: Need help with this cmd - KillerDVX - 26.12.2015

Don't you have a duty for admins?


Re: Need help with this cmd - Leopards - 26.12.2015

duty ? like spec something


Re: Need help with this cmd - SaltySandy - 26.12.2015

No.. As-in

PHP код:
AdminDuty == 
To declare if an admin is on-duty yes or no ( depends on how you defined the function to check if he/she is on-duty ).


Re: Need help with this cmd - Leopards - 26.12.2015

no there is no any adminduty == 1