achat +rep if you help
#1

can someone help me make a admin chat so when i type /a it sends my text to all admins using if(PlayerInfo[playerid][pAdmin] >= ), this is what i currently got
Код:
CMD:a(playerid, params[])
{
	new string[128];
	if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /a [adminchat]");
    format(string, sizeof(string), "Admin Chat: %s %s", GetName(playerid), params);
    printf("Admin Chat: %s %s", GetName(playerid), string);  // not sure if i need that
  
	return 1;
}
im just trying to figure out how to send this to all admins rep+ if you help
Reply
#2

pawn Код:
CMD:a(playerid, params[])
{
    new string[128];
    if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /a [adminchat]");
        format(string, sizeof(string), "Admin Chat: %s %s", GetName(playerid), params);
        printf("Admin Chat: %s %s", GetName(playerid), string);  // not sure if i need that
        for(new i=0;i<MAX_PLAYERS;i++)
        {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            SendClientMessage(i, string);
        }
        }
    return 1;
}
Reply
#3

wait
Код:
  C:\Documents and Settings\House\Desktop\samp\gamemodes\hrp.pwn(1712) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
how to fix?
Reply
#4

I guess it's
SendClientMessage(i, COLOR, string);
Reply
#5

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
I guess it's
SendClientMessage(i, COLOR, string);
Thanks for reminding...just didnt come into my mind..
Use this
pawn Код:
CMD:a(playerid, params[])
{
    new string[128];
    if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /a [adminchat]");
        format(string, sizeof(string), "Admin Chat: %s %s", GetName(playerid), params);
        printf("Admin Chat: %s %s", GetName(playerid), string);  // not sure if i need that
        for(new i=0;i<MAX_PLAYERS;i++)
        {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            SendClientMessage(i, -1, string);
        }
        }
    return 1;
}
Reply
#6

@[HK]Ryder[AN]:

Fix these indentation problems... You're killing my eyes '-'
Reply
#7

let me try and see if that works i can fix the indentations myself
Reply
#8

thanks guys it works rep+ to all
Reply
#9

Quote:
Originally Posted by arakuta
Посмотреть сообщение
@[HK]Ryder[AN]:

Fix these indentation problems... You're killing my eyes '-'
:/ I wrote that directly..
fixed
pawn Код:
CMD:a(playerid, params[])
{
    new string[128];
    if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /a [adminchat]");
    format(string, sizeof(string), "Admin Chat: %s %s", GetName(playerid), params);
    printf("Admin Chat: %s %s", GetName(playerid), string);  // not sure if i need that
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            SendClientMessage(i, -1, string);
        }
    }
    return 1;
}
Reply
#10

pawn Код:
CMD:a(playerid, params[])
{
    new string[128];
    if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /a [adminchat]");
        format(string, sizeof(string), "Admin Chat: %s %s", GetName(playerid), params);
        printf("Admin Chat: %s %s", GetName(playerid), string);  // not sure if i need that
        for(new i=0;i<MAX_PLAYERS;i++)
        {
            if(PlayerInfo[i][pAdmin] > 0)
            {
                SendClientMessage(i, string);
            }
        }
    return 1;
}
Take...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)