SA-MP Forums Archive
Changing zcmd to dcmd - 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: Changing zcmd to dcmd (/showthread.php?tid=441239)



Changing zcmd to dcmd - Fitri - 02.06.2013

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


Re: Changing zcmd to dcmd - CmZxC - 02.06.2013

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

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


Re: Changing zcmd to dcmd - Fitri - 02.06.2013

i dont want sscanf lol ==


Re: Changing zcmd to dcmd - DobbysGamertag - 02.06.2013

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


Re: Changing zcmd to dcmd - Fitri - 02.06.2013

as i see, LuxAdmin didnt use sscanf


Re: Changing zcmd to dcmd - JaKe Elite - 02.06.2013

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.


Re: Changing zcmd to dcmd - DobbysGamertag - 02.06.2013

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


Re: Changing zcmd to dcmd - Fitri - 02.06.2013

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


Re: Changing zcmd to dcmd - DobbysGamertag - 02.06.2013

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


Re: Changing zcmd to dcmd - Pottus - 02.06.2013

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