sscanf /radio
#3

Why dont you just use the dcmd 'params' string? - and get rid of sscanf from that script? - Something like this:

pawn Код:
dcmd_radio(playerid, params[])
{
    new rtext[240], rand1, rand2;
    if (strlen(params) == 0)
    {
        return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /radio <text>");
    }
else
{
     rtext = params;
}
    GetPlayerName(playerid, pName, sizeof(pName));
   
    rand1 = random(10+0);
    rand2 = random(10+0);
   
    if(PlayerInfo[playerid][pInfected] == 0 && PlayerInfo[playerid][pRadio] == 1)
    {
        if(rand1 < 4 && rand2 > 6)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(PlayerInfo[i][pInfected] == 0)
                {
                    format(nstring, sizeof(nstring), "[RADIO] %s: %s", pName, rtext);
                    SendClientMessage(i, COLOR_YELLOW, nstring);
                }
            }
        } else {
            SendClientMessage(playerid, COLOR_YELLOW, "You`re radio didnt found connection");
        }
    } else {
        SendClientMessage(playerid, COLOR_YELLOW, "You are infected or You dont have a radio!");
    }
    return 1;
}
Reply


Messages In This Thread
sscanf /radio - by corne - 24.11.2010, 19:04
Re: sscanf /radio - by Zh3r0 - 24.11.2010, 19:20
Re: sscanf /radio - by Ash. - 24.11.2010, 19:20
Re: sscanf /radio - by willsuckformoney - 24.11.2010, 19:22
Re: sscanf /radio - by corne - 24.11.2010, 19:27

Forum Jump:


Users browsing this thread: 2 Guest(s)