PDA

View Full Version : Help


Edw
23/01/2015, 04:25 PM
Hello. We have created a system to log and send message only to one player. How can I send a message to all admins are included with the level between 5 and 6.


#define LogMessage(%0,%1,%2,%3) format(string, sizeof(string),%2,%3) && SendClientMessage(%0, %1, string)

for(new i = 0; i < MAX_PLAYERS; i ++) { if(PlayerInfo[i][pLanguage] == 1 && PlayerInfo[i][pAdmin] >= 5) return LogMessage(i, COLOR_LOG, "AdmCmd: %s a acceptat report-ul lui %s.", sendername, giveplayer); else
if(PlayerInfo[i][pLanguage] == 2 && PlayerInfo[i][pAdmin] >= 5) return LogMessage(i, COLOR_LOG, "AdmCmd: %s accepted report of %s.", sendername, giveplayer); }

Riso135
23/01/2015, 04:42 PM
Next time try to search

btw. edited for your admin level
stock SendMessageToAdmins(text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 5)
{
SendClientMessage(i, 0xFFFFFFFF, text);
}
}
}

Edw
23/01/2015, 04:48 PM
warning 202: number of arguments does not match definition

LogMessage("AdmCmd: %s a acceptat report-ul lui %s.", sendername, giveplayer);

GGW
23/01/2015, 04:58 PM
Next time try to search

btw. edited for your admin level
stock SendMessageToAdmins(text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 5)
{
SendClientMessage(i, 0xFFFFFFFF, text);
}
}
}


to use the stoke you use this in your command

new string[250];
format(string, sizeof(string), "AdmCmd: %s a acceptat report-ul lui %s.", sendername, giveplayer);
SendMessageToAdmins(string);

Edw
23/01/2015, 07:21 PM
I tried this out! So it is, give message even if only one player I have admin> = 5 if I am alone in my sv just give me.

// Was correct as I did, the problem may be the loop?

Edw
23/01/2015, 08:29 PM
help!

Rodney Francalim
23/01/2015, 08:40 PM
#define LogMessage(%0,%1,%2,%3) format(string, sizeof(string),%2,%3) \ SendClientMessage(%0, %1, string)

for(new i = 0, string[128]; i < MAX_PLAYERS; ++i)
{
if(PlayerInfo[i][pLanguage] == 1 && (5 <= PlayerInfo[i][pAdmin] <= 6)) return LogMessage(i, COLOR_LOG, "AdmCmd: %s a acceptat report-ul lui %s.", sendername, giveplayer);
else if(PlayerInfo[i][pLanguage] == 2 && (5 <= PlayerInfo[i][pAdmin] <= 6)) return LogMessage(i, COLOR_LOG, "AdmCmd: %s accepted report of %s.", sendername, giveplayer);
}

Edw
23/01/2015, 09:05 PM
#define LogMessage(%0,%1,%2,%3) format(string, sizeof(string),%2,%3) && SendClientMessage(%0, %1, string)
for(new i = 0; i < MAX_PLAYERS; i ++) { if(PlayerInfo[i][pLanguage] == 1) return LogMessage(i, COLOR_LOG, "AdmCmd: %s a folosit comanda /gotomark.", sendername); else
if(PlayerInfo[i][pLanguage] == 2) return LogMessage(i, COLOR_LOG, "AdmCmd: %s used command /gotomark.", sendername); }


Even so doing, show message just a player.
If I did as you said the first error #define
error 001: expected token: ";", but found "\"

Rodney Francalim
23/01/2015, 09:09 PM
#define LogMessage(%0,%1,%2,%3) format(string, sizeof(string),%2,%3); SendClientMessage(%0, %1, string)

for(new i = 0, string[128]; i < MAX_PLAYERS; ++i)
{
if(PlayerInfo[i][pLanguage] == 1 && (5 <= PlayerInfo[i][pAdmin] <= 6)) return LogMessage(i, COLOR_LOG, "AdmCmd: %s a acceptat report-ul lui %s.", sendername, giveplayer);
else if(PlayerInfo[i][pLanguage] == 2 && (5 <= PlayerInfo[i][pAdmin] <= 6)) return LogMessage(i, COLOR_LOG, "AdmCmd: %s accepted report of %s.", sendername, giveplayer);
}

And if there's just you, the message'll be sent just to one player (in this case: you)...