Changing zcmd to dcmd
#1

hello i want you help me to change zcmd to dcmd using this command

NOTE:i dont want using sscanf because my server bugged on id 0

and dont advise to me to fix the sscanf coz i already use tut from _Jake_ and its not wotk

pawn Код:
CMD:radio(playerid, params[])
{
    ShowPlayerDialog(playerid, D_RADIO, DIALOG_STYLE_LIST, "Choose Radio Feed","-- TURN OFF RADIO --\n{33AA33}++Add Your URL{FFFFFF}\n{33AA33}++Add Your URL(STAFF){FFFFFF}\nMusic/News Radio","Listen","Exit");
    return 1;
}


CMD:setstream(playerid, params[])
{
        if(!IsPlayerAdmin( playerid ) ) return SendClientMessage(playerid, -1,"You must be a higher level admin to use this command");
        new level, aname[MAX_PLAYER_NAME];
        new targetid;
        if(sscanf(params, "ri", targetid, level)) return SendClientMessage(playerid, -1,"ERROR: /setstream <playerid> <1> allow stream <0> disallow");
        if (level > 1 || level < 0) return SendClientMessage(playerid, -1,"ERROR: invalid stream lol");
        if(!IsPlayerConnected( targetid )) return SendClientMessage(playerid, -1,"ERROR: player isn't connected");
        new string1[130], tname[MAX_PLAYER_NAME], string2[130];
        new INI:File = INI_Open(UserPath(targetid ));// here error line :/
        INI_SetTag(File,"data");
        INI_WriteInt(File,"Stream", pStream);
        INI_Close(File);
        PlayerInfo[targetid][pStream] = level;
        GetPlayerName(playerid, aname, sizeof(aname));
        GetPlayerName(targetid, tname, sizeof(tname));
        if(level == 1)
        {
        format(string1, sizeof(string1),"Administrator %s Has Set You Stream Level To STAFF, Enjoy",aname,level);
        SendClientMessage(targetid,0xFF9900AA,string1);
        return 1;
        }
        if(level == 0)
        {
        format(string2, sizeof(string2),"Administrator %s Has Demote You From Deejay STAFF",aname,level);
        SendClientMessage(targetid,0xFF9900AA,string2);
        return 1;
   }
   return 1;
}
sorry for my bad english lol

EDIT: sorry, you all not helping me :/ just make me stress
Reply
#2

zcmd is rather similar to dcmd, sscanf works on both.

https://sampwiki.blast.hk/wiki/Dcmd#zcmd
Reply
#3

i dont want sscanf lol ==
Reply
#4

Whats the issue with it? You're making a mistake somewhere if you're getting ID 0 bug.
Reply
#5

as i see, LuxAdmin didnt use sscanf
Reply
#6

Doesn't mean a popular admin system doesn't use sscanf, doesn't mean you will not use sscanf.
strtok is slow, and you're choosing a slow method. You're hating the fast method.
Reply
#7

Quote:
Originally Posted by Fitri
Посмотреть сообщение
as i see, LuxAdmin didnt use sscanf
LuxAdmin didnt use it. But it sure as hell had its bugs & exploits
Reply
#8

Quote:
Originally Posted by _Jake_
Посмотреть сообщение
Doesn't mean a popular admin system doesn't use sscanf, doesn't mean you will not use sscanf.
strtok is slow, and you're choosing a slow method. You're hating the fast method.
i didn't hating fast method, after i use /setstream 1 1

its say you have allowed player (id:0) to stream the music
Reply
#9

Then update it properly Make sure you're using the correct plugins to your OS. Linux uses .so while Windows uses .dll's
Reply
#10

Sounds like a completely assbackwards thing to do in my opinion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)