SA-MP Forums Archive
Need 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: Need help (/showthread.php?tid=287250)



Need help - zombieking - 02.10.2011

Hello , well I made a Army Radio Team Chat but when I type /armyradio Test or anything else the text won't appear ok this is my code:
pawn Код:
ocmd:armyradio(playerid,params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(GetPVarInt(playerid,"Survivor")==2)
    {
        if(GetPVarInt(i,"Survivor")==2)
        {
            new string[256],text[128];
            if(sscanf(params,"us",text))return SendClientMessage(playerid,red,"/armyradio [text]");
            format(string,256,"{41A600}[ARMY RADIO] {00EBFF}%s: {FF5A00}%s",PlayerName(playerid),text);
            SendClientMessage(i,red,string);
        }
    }
    return 1;
}



Re: Need help - Pharrel - 02.10.2011

pawn Код:
ocmd:armyradio(playerid,params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)// LOL
{    
if(GetPVarInt(playerid,"Survivor")==2)
    {
        if(GetPVarInt(i,"Survivor")==2)
        {
            new string[256],text[128];
            if(sscanf(params,"s",text))return SendClientMessage(playerid,red,"/armyradio [text]");//just "s" for an text
            format(string,/*256 LoL*/128,"{41A600}[ARMY RADIO] {00EBFF}%s: {FF5A00}%s",PlayerName(playerid),text);
            SendClientMessage(i,red,string);
        }
    }
}    
return 1;
}



Re: Need help - zombieking - 02.10.2011

Thanks it works! I'll give you rep


Re: Need help - zombieking - 02.10.2011

One more problem , I have a /inventory command and it should say : Medkits ---------- [number of medkits] but it only says Medkits ------------- no number here , well here is my code:
pawn Код:
ocmd:inventory(playerid,params[])
{
    new string[128];
    format(string,128,"MedKits ------------------- %s",Medkits[playerid]);
    SendClientMessage(playerid,0xFF9600FF,string);
    return 1;
}



Re: Need help - Libra_PL - 02.10.2011

Код:
ocmd:inventory(playerid,params[])
{
    new string[128];
    format(string,128,"MedKits ------------------- %d",Medkits[playerid]);
    SendClientMessage(playerid,0xFF9600FF,string);
    return 1;
}
Change from %s to %d.


Re: Need help - zombieking - 02.10.2011

Thanks I give rep to you too