Radio
#1

I tryed to make new radio system. So when i rent channel it like makes it on config file, but it doesnt set the right password and i cant /auth on channel

It sets my pasword like this - http://www.bildites.lv/images/6th3mwh19r33g4bmpmx2.png

My Radio System

PHP код:
enum RInfo
{
    
radioChannel,
    
radioOwner[MAX_PLAYER_NAME],
    
radioPass,
    
radioOn
};
new 
RadiosInfo[MAX_RADIOS][RInfo];
SaveRadios() {
    new
        
szFileStr[1024],
        
FilefHandle fopen("radio.cfg"io_write);
    for(new 
iIndexiIndex MAX_RADIOSiIndex++) {
        
format(szFileStrsizeof(szFileStr), "%d|%s|%s|%d\r\n",
            
RadiosInfo[iIndex][radioChannel],
            
RadiosInfo[iIndex][radioOwner],
            
RadiosInfo[iIndex][radioPass],
            
RadiosInfo[iIndex][radioOn]
        );
        
fwrite(fHandleszFileStr);
    }
    return 
fclose(fHandle);
}
LoadRadios()
{
    new 
arrCoords[31][64];
    new 
strFromFile2[256];
    new 
Filefile fopen("radio.cfg"io_read);
    if(
file)
    {
        new 
idx;
        while (
idx sizeof(RadiosInfo))
        {
            
fread(filestrFromFile2);
            
splits(strFromFile2arrCoords'|');
            
RadiosInfo[idx][radioChannel] = strval(arrCoords[0]);
            
strmid(RadiosInfo[idx][radioOwner], arrCoords[1], 0strlen(arrCoords[1]), 255);
            
strmid(RadiosInfo[idx][radioPass], arrCoords[2], 0strlen(arrCoords[2]), 255);
            
RadiosInfo[idx][radioOn] = strval(arrCoords[3]);
            
idx++;
        }
        
fclose(file);
    }
    return 
1;
}
    
LoadRadios();//OnGameModeInit
forward SendRadioMessageNew(playeridchannelcolorstring[]);
public 
SendRadioMessageNew(playeridchannelcolorstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
gPlayerLogged{i} != 0)
        {
             if(
PlayerInfo[i][pChannel] == channel && PlayerInfo[i][pSlot] == PlayerInfo[playerid][pSlot])
              {
                  if(
PlayerInfo[i][pAuthed] == 1)
                {
                    
SendClientMessageEx(icolorstring);
                }
            }
        }
    }
}
stock CompareStrings(string[], string2[])
{
    if(!
strcmp(stringstring2true))
        return 
true;
    else
        return 
false;
}
stock ShowRadioTextDraw(playerid)
{
    
PlayerTextDrawShow(playeridRadioDraw[playerid]);
    
PlayerTextDrawShow(playeridChannelDraw[playerid]);
    
PlayerTextDrawShow(playeridSlotDraw[playerid]);
    
SetRadioChannel(playeridGetPlayerChannel(playerid));
    
SetRadioSlot(playeridGetPlayerSlot(playerid));
    return 
1;
}
stock HideRadioTextDraw(playerid)
{
    
PlayerTextDrawHide(playeridRadioDraw[playerid]);
    
PlayerTextDrawHide(playeridChannelDraw[playerid]);
    
PlayerTextDrawHide(playeridSlotDraw[playerid]);
    return 
1;
}
stock RadioMSG(playeridmessage[])
{
    new 
msg[128];
    
format(msgsizeof(msg), "{00FFFF}[Radio]{DADADA}: %s"message); 
    return 
SendClientMessageEx(playerid, -1msg);
}
stock SetRadioChannel(playeridchannel)
{
    new 
msg[128];
    if(
channel == 0)
    {
        
format(msgsizeof(msg), "~b~Chan: ~h~~g~0");
        
PlayerInfo[playerid][pAuthed] = 0;
    }
    else
    {
        
format(msgsizeof(msg), "~b~Chan: ~h~~g~%d"channel);
    }
    
PlayerTextDrawSetString(playeridChannelDraw[playerid], msg);
    
PlayerInfo[playerid][pChannel] = channel;
    return 
1;
}
stock SetRadioSlot(playeridslot)
{
    new 
msg[128];
    
format(msgsizeof(msg), "~b~Slot: ~h~~g~%d"slot);
    
PlayerTextDrawSetString(playeridSlotDraw[playerid], msg);
    
PlayerInfo[playerid][pSlot] = slot;
    return 
1;
}
stock GetPlayerChannel(playerid) return PlayerInfo[playerid][pChannel];
stock GetPlayerSlot(playerid) return PlayerInfo[playerid][pSlot];
stock GetOwnedChannel(playerid) return PlayerInfo[playerid][pOwnedChannel]; 
stock PlayerOwnChannel(playerid
{
    if(
PlayerInfo[playerid][pOwnedChannel] > 0)
        return 
true;
    else
        return 
false;
}
stock ChannelExist(channelid)
{
    for(new 
0MAX_RADIOSi++)
    {
        if(
RadiosInfo[i][radioChannel] == channelid && RadiosInfo[i][radioOn] == 1)
        {
            return 
true;
        }
    }
    return 
false;
}
stock GetChannelSlot(channelid)
{
    for(new 
0MAX_RADIOSi++)
    {
        if(
RadiosInfo[i][radioChannel] == channelid)
        {
            return 
i;
        }
    }
    return 
0;
}
stock CompareStrings(string[], string2[])
{
    if(!
strcmp(stringstring2true))
        return 
true;
    else
        return 
false;
}
stock AuthPassCorrect(slotidauthpass[])
{
    if(
CompareStrings(authpassRadiosInfo[slotid][radioPass]))
        return 
true;
    else
        return 
false;
}
stock GetNextChannelSlot()
{
    new 
i=0;
    while(
!= MAX_RADIOS
    {
        if(
RadiosInfo[i][radioOn] == 0)
        { 
            return 
i;
        }
        
i++;
    }
    return -
1;
}
stock StringHasSymbols(string[])
{
    for(new 
0strlen(string); i++)
    {
        switch(
string[i])
        {
            case 
'!''@''#''$','%','^','&','*','(',')','_','+','=','|','[',']','{','}','-','.','`','~','<','>','?',',','/': return true;
            default: continue;
        }
    }
    return 
false;
}
forward SendProxRadioMessage(playeridstring[]);
public 
SendProxRadioMessage(playeridstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
gPlayerLogged{i} != 0)
        {
            if(
!= playerid)
            {
                if(
GetDistanceBetweenPlayers(playerid,i) < 8)
                { 
SendClientMessageEx(iCOLOR_FADE1string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 8)
                { 
SendClientMessageEx(iCOLOR_FADE2string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 12)
                { 
SendClientMessageEx(iCOLOR_FADE3string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 16)
                { 
SendClientMessageEx(iCOLOR_FADE4string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 20)
                { 
SendClientMessageEx(iCOLOR_FADE5string); }
            }
        }
    }
}
forward SendLowProxRadioMessage(playeridstring[]);
public 
SendLowProxRadioMessage(playeridstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
gPlayerLogged{i} != 0)
        {
            if(
!= playerid)
            {
                if(
GetDistanceBetweenPlayers(playerid,i) < 3)
                { 
SendClientMessageEx(iCOLOR_FADE1string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 3)
                { 
SendClientMessageEx(iCOLOR_FADE2string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 5)
                { 
SendClientMessageEx(iCOLOR_FADE3string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 7)
                { 
SendClientMessageEx(iCOLOR_FADE4string); }
                else if(
GetDistanceBetweenPlayers(playerid,i) < 9)
                { 
SendClientMessageEx(iCOLOR_FADE5string); }
            }
        }
    }
}
CMD:radiohelp(playeridparams[])
{
    
SendClientMessageEx(playeridCOLOR_LIGHTGREEN,"|___________________Radio Help___________________|");
    
SendClientMessageEx(playeridCOLOR_YELLOWG,"HINT: You can buy radio in 24-7's!");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/r - Talk over radio, in the channel you've set.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/rlow - Talk LOW over radio, in the channel you've set.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/auth - You must authorize yourself to each channel.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/setchannel - Sets which channel you want on which slot.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/setslot - Sets which slot you want on which channel.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/leavechannel - To leave the radio channel you're currently in.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/sellchannel - If you own a channel, you may sell it. (50% back)");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/newauth - If you own a channel, you may change the authorization pass.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/kickoffradio - If you own a channel, you may kick someone.");
    
SendClientMessageEx(playeridCOLOR_WHITE,"/radiomembers - If you own a channel, displays the members inside.");
    return 
1;
}
CMD:rentchannel(playeridparams[])
{
    new 
channelidpass[128], cost 30000;
    new 
msg[128];
    if(
sscanf(params"ds[128]"channelidpass))
    {
        
SendClientMessageEx(playeridCOLOR_GREY"USAGE: /rentchannel [channel-id(1-9999)] [auth pass]");
        
SendClientMessageEx(playeridCOLOR_RED"[WARNING]: Do not use symbols at your auth pass.");
        return 
1;
    }
    if(
channelid 9999 || channelid <= 0) return RadioMSG(playerid"Invalid channel id, 1-9999.");
    if(!
IsPlayerInRangeOfPoint(playerid2.01154.4916,-1457.8672,15.7969)) return SendClientMessageEx(playeridCOLOR_GRAD2"You're not at the mall office.");
    if(
PlayerOwnChannel(playerid)) return RadioMSG(playerid"You already own a radio channel, '/sellchannel' to sell it.");
    if(
ChannelExist(channelid)) return RadioMSG(playerid"This channel is already taken.");
    if(
StringHasSymbols(pass)) return SendClientMessageEx(playeridCOLOR_LIGHTRED"Do not use symbols at your authorization password!");
    if(
GetPlayerCash(playerid) < cost) return SendClientMessageEx(playeridCOLOR_GRAD2"You can't afford radio!");
    
GivePlayerCash(playerid, -cost);
    new 
channelslot GetNextChannelSlot();
    
format(msgsizeof(msg), "You have rented a radio channel: %d, you may type '/radiohelp' for more info."channelid);
    
RadioMSG(playeridmsg);
    
PlayerInfo[playerid][pOwnedChannel] = channelid;
    
RadiosInfo[channelslot][radioChannel] = channelid;
    
format(RadiosInfo[channelslot][radioOwner], 128"%s"GetPlayerNameEx(playerid));
    
format(RadiosInfo[channelslot][radioPass], 128"%s"pass);
    
RadiosInfo[channelslot][radioOn] = 1;
    
SaveRadios();
    return 
1;
}
CMD:sellchannel(playeridparams[])
{
    new 
msg[128];
    new 
award 15000;
    new 
owned GetOwnedChannel(playerid);
    new 
channelslot GetChannelSlot(owned);
    new 
channel GetPlayerChannel(playerid);
    if(!
PlayerOwnChannel(playerid)) return RadioMSG(playerid"You don't own any channel.");
    if(
channel != owned) return RadioMSG(playerid"You must be connected to your channel.");
    
GivePlayerCash(playeridaward);
    
format(msgsizeof(msg), "You have just sold your radio channel: %d, for the government and earned $%d."owned,award);
    
RadioMSG(playeridmsg);
    foreach(
Playeri)
    {
        if(
GetPlayerChannel(i) == owned && != playerid)
        {
            
RadioMSG(i"The radio channel you are in has just been sold, and you were kicked out.");
            
SetRadioChannel(i0);
        }
    }
    
RadiosInfo[channelslot][radioChannel] = 0;
    
format(RadiosInfo[channelslot][radioOwner], 128"The State");
    
RadiosInfo[channelslot][radioOn] = 0;
    
PlayerInfo[playerid][pChannel] = 0;
    
PlayerInfo[playerid][pOwnedChannel] = 0;
    
SetRadioChannel(playerid0);
    
SaveRadios();
    return 
1;
}
CMD:setchannel(playeridparams[])
{
    new 
msg[128];
    new 
channelid,slot;
    if(
sscanf(params"dd"channelidslot)) return Syntax(playerid"/setchannel [channel-id] [slot(1-3)]");
    if(
PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, -1"You don't have a radio.");
    if(!
ChannelExist(channelid)) return RadioMSG(playerid"No such channel.");
    if(
channelid == 911 && PlayerInfo[playerid][pMember] != 1) return SendClientMessageEx(playeridCOLOR_GREY"Your radio doesn't support in this channel (LSPD).");
    if(
channelid == GetPlayerChannel(playerid)) return RadioMSG(playerid"You are in this channel already.");
    
format(msgsizeof(msg), "Radio Channel sET [CH: %d, Slot: %d]"channelidslot);
    
SendClientMessageEx(playeridCOLOR_GREENmsg);
    
RadioMSG(playerid"Before you can /r please authorize, /auth.");
    
PlayerInfo[playerid][pAuthed] = 0;
    
SetRadioChannel(playeridchannelid);
    
SetRadioSlot(playeridslot);
    return 
1;
}
CMD:setslot(playeridparams[])
{
    new 
slot;
    if(
sscanf(params"d"slot)) return Syntax(playerid"/setslot [slot-id]");
    if(
PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, -1"You don't have a radio.");
    if(
slot == GetPlayerSlot(playerid)) return RadioMSG(playerid"You are in this slot already.");
    if(
slot || slot 1) return SendClientMessageEx(playeridCOLOR_GREY"Slot must be 1-3.");
    
SetRadioSlot(playeridslot);
    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"You have set your radio slot to %d."slot);
    return 
1;
}
CMD:leavechannel(playeridparams[])
{
    new 
msg[128];
    new 
channel GetPlayerChannel(playerid);
    if(
PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, -1"You don't have a radio.");
    if(
channel == 0) return RadioMSG(playerid"You're not in any channel.");
    
format(msgsizeof(msg), "You have just left your current radio channel %d."channel);
    
RadioMSG(playeridmsg);
    
SetRadioChannel(playerid0);
    return 
1;
}
CMD:auth(playeridparams[])
{
    new 
pass[128];
    new 
msg[128];
    if(
sscanf(params"s[128]"pass)) return Syntax(playerid"/auth [channel password]");
    if(
PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, -1"You don't have a radio.");
    new 
channel GetPlayerChannel(playerid);
    new 
slotid GetChannelSlot(channel);
    if(
channel == 0) return RadioMSG(playerid"You're not in any channel.");
    if(
PlayerInfo[playerid][pAuthed] == 1) return RadioMSG(playerid"You are already authorized in your current channel.");
    if(!
AuthPassCorrect(slotidpass)) return RadioMSG(playerid"Invalid authorization password.");
    
format(msgsizeof(msg), "You have been authorized to use this channel, password: %s."pass);
    
RadioMSG(playeridmsg);
    
PlayerInfo[playerid][pAuthed] = 1;
    return 
1;
}
CMD:newauth(playeridparams[])
{
    new 
msg[128];
    new 
oldpass[128], newpass[128];
    if(
sscanf(params"s[128]s[128]"oldpassnewpass)) return Syntax(playerid"/newauth [old password] [new password]");
    new 
channel GetOwnedChannel(playerid);
    new 
slot GetChannelSlot(channel);
    if(!
PlayerOwnChannel(playerid)) return RadioMSG(playerid"You don't own any channel.");
    if(!
AuthPassCorrect(slotoldpass)) return RadioMSG(playerid"Invalid authorization password.");
    
format(msgsizeof(msg), "Your authorization password has been changed to, %s."newpass);
    
RadioMSG(playeridmsg);
    
format(RadiosInfo[slot][radioPass], 128"%s"newpass);
    
SaveRadios();
    return 
1;
}
CMD:radiomembers(playeridparams[])
{
    new 
msg[128];
    new 
channel GetPlayerChannel(playerid);
    new 
owned GetOwnedChannel(playerid);
    if(!
PlayerOwnChannel(playerid)) return SendClientMessageEx(playeridCOLOR_YELLOWG"You don't own any channel.");
    if(
channel != owned) return RadioMSG(playerid"You must be connected to your channel.");
    
SendClientMessageEx(playeridCOLOR_YELLOWG"|_____________Radio Members_____________|");
    foreach(
Playeri)
    {
        if(
GetPlayerChannel(i) == owned && != playerid)
        {
            
format(msgsizeof(msg), "[ID:%d]%s."iGetPlayerNameEx(i));
            
SendClientMessageEx(playeridCOLOR_FADE2msg);
        }
    }
    
SendClientMessageEx(playeridCOLOR_YELLOWG"|______________________________________|");
    return 
1;
}
CMD:kickoffradio(playeridparams[])
{
    new 
id;
    new 
msg[128];
    if(
sscanf(params"u"id)) return Syntax(playerid"/kickoffradio [playerid]");
    
//if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
    
if(id == playerid) return SendClientMessageEx(playeridCOLOR_WHITE"You may not kick yourself.");
    new 
channel GetPlayerChannel(playerid);
    new 
owned GetOwnedChannel(playerid);
    if(!
PlayerOwnChannel(playerid)) return RadioMSG(playerid"You don't own any channel.");
    if(
channel != owned) return RadioMSG(playerid"You must be connected to your channel.");
    if(
GetPlayerChannel(id) == owned)
    {
        
format(msgsizeof(msg), "You have just kicked %s from your radio."GetPlayerNameEx(id));
        
RadioMSG(playeridmsg);
        
RadioMSG(id"You have been kicked from the radio channel you're currently in.");
        
SetRadioChannel(id0);
    }
    else return 
RadioMSG(playerid"This player isn't in your radio channel.");
    return 
1;
}
CMD:radio(playeridparams[]) return cmd_r(playeridparams);
CMD:r(playeridparams[])
{
    new 
msg[128];
    new 
text[128];
    new 
channel GetPlayerChannel(playerid);
    new 
slot GetPlayerSlot(playerid);
    if(
sscanf(params"s[128]"text)) return Syntax(playerid"(/r)adio [text]");
    if(
PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, -1"You don't have a radio.");
    if(
channel == 0) return RadioMSG(playerid"You're not in any channel.");
    if(
PlayerInfo[playerid][pAuthed] == 0) return RadioMSG(playerid"You are not authorized in your current channel.");
    if(
strlen(text) > MAXLEN)
    {
        new 
pos MAXLEN;
        if(
pos MAXLEN-1pos MAXLEN;
        
format(msgsizeof(msg), "**[CH: %d S: %d] %s: %.*s ..."channelslotGetPlayerNameEx(playerid), postext);
        
SendRadioMessageNew(playeridchannelRADIOmsg);
        
format(msgsizeof(msg), "**[CH: %d S: %d] %s: ... %s"channelslotGetPlayerNameEx(playerid), text[pos]);
        
SendRadioMessageNew(playeridchannelRADIOmsg);
    }
    else
    {
        
format(msgsizeof(msg), "**[CH: %d S: %d] %s: %s"channelslotGetPlayerNameEx(playerid), text);
        
SendRadioMessageNew(playeridchannelRADIOmsg);
    }
    if(
strlen(text) > MAXLEN)
    {
        new 
pos MAXLEN;
        if(
pos MAXLEN-1pos MAXLEN;
        
format(msgsizeof(msg), "(Radio) %s says: %.*s ..."GetPlayerNameEx(playerid), postext);
        
SendProxRadioMessage(playeridmsg);
        
format(msgsizeof(msg), "(Radio) %s says: ... %s"GetPlayerNameEx(playerid), text[pos]);
        
SendProxRadioMessage(playeridmsg);
    }
    else
    {
        
format(msgsizeof(msg), "(Radio) %s says: %s"GetPlayerNameEx(playerid), text);
        
SendProxRadioMessage(playeridmsg);
    }
    return 
1;
}
CMD:rlow(playeridparams[])
{
    new 
msg[128];
    new 
text[128];
    new 
channel GetPlayerChannel(playerid);
    if(
sscanf(params"s[128]"text)) return Syntax(playerid"/rlow [text]");
    if(
PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, -1"You don't have a radio.");
    if(
channel == 0) return RadioMSG(playerid"You're not in any channel.");
    if(
PlayerInfo[playerid][pAuthed] == 0) return RadioMSG(playerid"You are not authorized in your current channel.");
        new 
        
rank[64], 
        
division[64],
        
employer[64];
        
    
GetPlayerFactionInfo(playeridrankdivisionemployer);
    if(
PlayerInfo[playerid][pMember] == && channel == 911)
    {
        if(
strlen(text) > MAXLEN)
        {
            new 
pos MAXLEN;
            if(
pos MAXLEN-1pos MAXLEN;
            
format(msgsizeof(msg), "**[CH: %d] %s %s: %.*s ..."channelrankGetPlayerNameEx(playerid), postext);
            
SendRadioMessageNew(playeridchannelRADIOmsg);
            
format(msgsizeof(msg), "**[CH: %d] %s %s: ... %s"channelrankGetPlayerNameEx(playerid), text[pos]);
            
SendRadioMessageNew(playeridchannelRADIOmsg);
        }
        else
        {
            
format(msgsizeof(msg), "**[CH: %d] %s %s: %s"channelrankGetPlayerNameEx(playerid), text);
            
SendRadioMessageNew(playeridchannelRADIOmsg);
        }
        if(
strlen(text) > MAXLEN)
        {
            new 
pos MAXLEN;
            if(
pos MAXLEN-1pos MAXLEN;
            
format(msgsizeof(msg), "(Radio) %s says (low): %.*s ..."GetPlayerNameEx(playerid), postext);
            
SendLowProxRadioMessage(playeridmsg);
            
format(msgsizeof(msg), "(Radio) %s says (low): ... %s"GetPlayerNameEx(playerid), text[pos]);
            
SendLowProxRadioMessage(playeridmsg);
        }
        else
        {
            
format(msgsizeof(msg), "(Radio) %s says (low): %s"GetPlayerNameEx(playerid), text);
            
SendLowProxRadioMessage(playeridmsg);
        }
    }
    else
    {
        if(
strlen(text) > MAXLEN)
        {
            new 
pos MAXLEN;
            if(
pos MAXLEN-1pos MAXLEN;
            
format(msgsizeof(msg), "**[CH: %d] %s: %.*s ..."channelGetPlayerNameEx(playerid), postext);
            
SendRadioMessageNew(playeridchannelRADIOmsg);
            
format(msgsizeof(msg), "**[CH: %d] %s: ... %s"channelGetPlayerNameEx(playerid), text[pos]);
            
SendRadioMessageNew(playeridchannelRADIOmsg);
        }
        else
        {
            
format(msgsizeof(msg), "**[CH: %d] %s: %s"channelGetPlayerNameEx(playerid), text);
            
SendRadioMessageNew(playeridchannelRADIOmsg);
        }
        if(
strlen(text) > MAXLEN)
        {
            new 
pos MAXLEN;
            if(
pos MAXLEN-1pos MAXLEN;
            
format(msgsizeof(msg), "(Radio) %s says (low): %.*s ..."GetPlayerNameEx(playerid), postext);
            
SendLowProxRadioMessage(playeridmsg);
            
format(msgsizeof(msg), "(Radio) %s says (low): ... %s"GetPlayerNameEx(playerid), text[pos]);
            
SendLowProxRadioMessage(playeridmsg);
        }
        else
        {
            
format(msgsizeof(msg), "(Radio) %s says (low): %s"GetPlayerNameEx(playerid), text);
            
SendLowProxRadioMessage(playeridmsg);
        }
    }
    return 
1;

I changed code to

PHP код:
SaveRadios() {
    new
        
szFileStr[512],
        
FilefHandle fopen("radio.cfg"io_write);
    for(new 
iIndexiIndex MAX_RADIOSiIndex++) {
        
format(szFileStrsizeof(szFileStr), "%d|%s|%s|%d\r\n",
            
RadiosInfo[iIndex][radioChannel],
            
RadiosInfo[iIndex][radioOwner],
            
RadiosInfo[iIndex][radioPass],
            
RadiosInfo[iIndex][radioOn]
        );
        
fwrite(fHandleszFileStr);
    }
    return 
fclose(fHandle);
}
LoadRadios()
{
    if(!
fexist("radio.cfg")) return 1;
    new
        
szFileStr[512], 
        
FilefHandle fopen("radio.cfg"io_read);
    for(new 
iArrayIndexiArrayIndex sizeof(RadiosInfo); ++iArrayIndex) {
        
fread(fHandleszFileStr);
        
sscanf(szFileStr"p<|>ds[24]s[24]d",
            
RadiosInfo[iArrayIndex][radioChannel],
            
RadiosInfo[iArrayIndex][radioOwner],
            
RadiosInfo[iArrayIndex][radioPass],
            
RadiosInfo[iArrayIndex][radioOn]
        );
        ++
iArrayIndex;
    }
    return 
fclose(fHandle);

And Nothing changed
Reply


Messages In This Thread
Radio - by FaZeRs - 08.01.2015, 21:37
Re: Radio - by FaZeRs - 08.01.2015, 23:22
Re: Radio - by Raisingz - 09.01.2015, 01:05
Re: Radio - by FaZeRs - 09.01.2015, 03:06
Re: Radio - by FaZeRs - 11.01.2015, 21:33
Re: Radio - by Jefff - 12.01.2015, 01:50

Forum Jump:


Users browsing this thread: 1 Guest(s)