SA-MP Forums Archive
achat +rep if you help - 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: achat +rep if you help (/showthread.php?tid=405125)



achat +rep if you help - cluckintucker - 05.01.2013

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


Re: achat +rep if you help - [HK]Ryder[AN] - 05.01.2013

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;
}



Re: achat +rep if you help - cluckintucker - 05.01.2013

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?


Re: achat +rep if you help - Mr.Anonymous - 05.01.2013

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


Re: achat +rep if you help - [HK]Ryder[AN] - 05.01.2013

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;
}



Re: achat +rep if you help - arakuta - 05.01.2013

@[HK]Ryder[AN]:

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


Re: achat +rep if you help - cluckintucker - 05.01.2013

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


Re: achat +rep if you help - cluckintucker - 05.01.2013

thanks guys it works rep+ to all


Re: achat +rep if you help - [HK]Ryder[AN] - 05.01.2013

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;
}



Re: achat +rep if you help - -=Dar[K]Lord=- - 05.01.2013

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...