Ermm, /radio command?
#1

PHP код:
CMD:radio(playeridparams[])
{
    new 
string[128];
     
format(file128"/SRP/%s.ini"GetName(playerid));
    new 
tekst;
    if(
dini_Int(file"Frakcja") == 1)
    {
        if(
dini_IntSet(file"RangaWFrakcji"6))
        {
            
format(stringsizeof(string), "Rank 6 %s (radio): %s, odbiуr."GetName(playerid), tekst);
        }
        if(
dini_IntSet(file"RangaWFrakcji"5))
        {
            
format(stringsizeof(string), "Rank 5 %s (radio): %s, odbiуr."GetName(playerid), tekst);
        }
        if(
dini_IntSet(file"RangaWFrakcji"4))
        {
            
format(stringsizeof(string), "Rank 4 %s (radio): %s, odbiуr."GetName(playerid), tekst);
        }
        if(
dini_IntSet(file"RangaWFrakcji"3))
        {
            
format(stringsizeof(string), "Rank 3 %s (radio): %s, odbiуr."GetName(playerid), tekst);
        }
        if(
dini_IntSet(file"RangaWFrakcji"2))
        {
            
format(stringsizeof(string), "Rank 3 %s (radio): %s, odbiуr."GetName(playerid), tekst);
        }
        if(
dini_IntSet(file"RangaWFrakcji"1))
        {
            
format(stringsizeof(string), "Rank 3 %s (radio): %s, odbiуr."GetName(playerid), tekst);
        }
          
SendClientMessage(playeridCOLOR_BLUEstring);
    }
    return 
1;

Okey, it shows me
Код:
Rank 3 MY NAME (radio): , odbiуr.
instead of
Код:
Rank 3 MY NAME (radio): hello i wrote this, odbiуr.
Reply
#2

pawn Код:
CMD:radio(playerid, params[])
{
    new string[60];
     format(file, 60, "/SRP/%s.ini", GetName(playerid));
    new tekst[128];
    if(sscanf(params,"s",tekst)) return SendClientMessage(playerid, COLOR_BLUE, " USAGE: /radio [text]");
    if(dini_Int(file, "Frakcja") == 1)
    {
        if(dini_IntSet(file, "RangaWFrakcji", 6))
        {
            format(string, sizeof(string), "Rank 6 %s (radio): %s, odbiуr.", GetName(playerid), tekst);
        }
        else if(dini_IntSet(file, "RangaWFrakcji", 5))
        {
            format(string, sizeof(string), "Rank 5 %s (radio): %s, odbiуr.", GetName(playerid), tekst);
        }
        else if(dini_IntSet(file, "RangaWFrakcji", 4))
        {
            format(string, sizeof(string), "Rank 4 %s (radio): %s, odbiуr.", GetName(playerid), tekst);
        }
        else if(dini_IntSet(file, "RangaWFrakcji", 3))
        {
            format(string, sizeof(string), "Rank 3 %s (radio): %s, odbiуr.", GetName(playerid), tekst);
        }
        else if(dini_IntSet(file, "RangaWFrakcji", 2))
        {
            format(string, sizeof(string), "Rank 3 %s (radio): %s, odbiуr.", GetName(playerid), tekst);
        }
        else if(dini_IntSet(file, "RangaWFrakcji", 1))
        {
            format(string, sizeof(string), "Rank 3 %s (radio): %s, odbiуr.", GetName(playerid), tekst);
        }
          SendClientMessage(playerid, COLOR_BLUE, string);
    }
    return 1;
}
Reply
#3

You do not put anything into tekst, also it is not a string but an integer (new tekst[128])

Edit: ah, wups was faster
Reply
#4

thanks.
Код:
The message you have entered is too short. Please lengthen your message to at least 8 characters.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)