SA-MP Forums Archive
From sscanf to strcmp - 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: From sscanf to strcmp (/showthread.php?tid=416984)



From sscanf to strcmp - Marcuse - 19.02.2013

Is there any way to remove tha sscanf from this cmd and put it into strcmp
If yes pls post it or help me in any way i need it asap

Код:
    if(strcmp(cmd,"/offpostaviadmina",true)==0)
        {
                    if(PlayerInfo[playerid][pAdmin] < 1338) return SCM(playerid,COLOR_WHITE,"Nisi ovlascen da koristis ovu komandu");
                    new string[256];
                    new sendername[MAX_PLAYER_NAME];
                    new playername[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new level;
                    if(sscanf(params,"sd",playername,level)) return SCM(playerid, COLOR_GREY,"{00C0FF}Koriscenje:{ffffff} /offpostaviadmina [Ime_Prezime] [Administrator level]");
                    if(AccountVanIGre(playername))
                    {
                            OffLogiranje(playername);
                    PlayerInfo[MAX_PLAYERS][pAdmin] = level;
                    OffCuvanje(playername);
                            format(string, sizeof(string), "[OFFLINE] Admin: %s je dao Admina igracu %s || Admin Level; %d",sendername,playername,level);
                    PosaljiAdminimaPoruku(COLOR_YELLOW,string);
                    }
                    return 1;
            }



Re: From sscanf to strcmp - FUNExtreme - 19.02.2013

No..


Re: From sscanf to strcmp - LarzI - 19.02.2013

Yes, but it's very very inefficient and unprecise unless you know exactly what you're doing (unless you're using strtok - it's still inefficient though).

Why would you even want to swap it? Just get the plugin and the include.


Re: From sscanf to strcmp - Marcuse - 19.02.2013

Dunno my friend asked me to do it he said something that he doesnt know to work with sscanf


Re: From sscanf to strcmp - LarzI - 19.02.2013

Well then he should learn it, as it is incredibly easy