SA-MP Forums Archive
GameTextForAll - announcing - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GameTextForAll - announcing (/showthread.php?tid=64077)



GameTextForAll - announcing - StrickenKid - 01.02.2009

i want to announce a message to everyone on my server my doing
/an [message] and have it go on there screen like the GameTextForAll function but i cant figure out how to do it, can anyone plz help!


Re: GameTextForAll - announcing - Mikep - 01.02.2009

Search for strtok/sscanf


Re: GameTextForAll - announcing - StrickenKid - 01.02.2009

i just need the pwn code plz


Re: GameTextForAll - announcing - Ghett0 - 01.02.2009

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if((strcmp(cmdtext, "/an", true, 3) == 0) && IsPlayerAdmin(playerid))
    {
        strdel(cmdtext, 0, 4);
        GameTextForAll(cmdtext, 2000, 3);
        return 1;
    }
    return 0;
}
There. You'll have to be logged into rcon to use it.


Re: GameTextForAll - announcing - Mikep - 01.02.2009

Learn to code or ask in Scripting Request.


Re: GameTextForAll - announcing - StrickenKid - 01.02.2009

thankyou Ghett0!


Re: GameTextForAll - announcing - Ghett0 - 01.02.2009

Quote:
Originally Posted by ssǝן‾ʎ
Err, what happens if you type "/an" (nothing after)?
It'll just send " ". Though, if it bothers you that much...

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if((strcmp(cmdtext, "/an", true, 3) == 0) && (strlen(cmdtext) => 5) && IsPlayerAdmin(playerid))
    {
        strdel(cmdtext, 0, 4);
        GameTextForAll(cmdtext, 2000, 3);
        return 1;
    }
    return 0;
}



Re: GameTextForAll - announcing - Monti|spearrow - 01.02.2009

If GameTextFor** get an empty string to send, it will crash the server. I tested it


Re: GameTextForAll - announcing - Ghett0 - 01.02.2009

Quote:
Originally Posted by Monti|spearrow
If GameTextFor** get an empty string to send, it will crash the server. I tested it
Yeah, I reposted the function with a fix.