SA-MP Forums Archive
strfind,strdel [rep+] - 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: strfind,strdel [rep+] (/showthread.php?tid=302235)



strfind,strdel [rep+] - xMichaelx - 08.12.2011

Hey,

Basically i need to use strfind and strdel for my admin chat system, could anyone give me the link to where to find this example? Or even the code in use.
pawn Код:
if(strcmp(text,"#",true, 1) == 0)
    {
        if(PlayerInfo[playerid][pAdminLevel] >= 1)
        {
                GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
                switch(PlayerInfo[playerid][pAdminLevel])
                {
                    case 1: LevelName = "Moderator";
                    case 2: LevelName = "Administrator";
                    case 3: LevelName = "Senior Administrator";
                    case 4: LevelName = "Main Administrator";
                    case 5: LevelName = "Head Administrator";
                    case 6: LevelName = "Senior Head Administrator";
                    case 7: LevelName = "Trusted Administrator";
                    case 8: LevelName = "Owner";
                }

                format(string,sizeof(string),"[Admin Chat] %s %s: %s",LevelName,pname,text);
                SendClientMessageToAdmins(COLOR_BLUE,string);
        }
        else return 0;
        return 0;
    }
Thanks,

-Michael


Re: strfind,strdel [rep+] - SuperViper - 08.12.2011

pawn Код:
if(strcmp(text,"#",true, 1) == 0)
    {
        if(PlayerInfo[playerid][pAdminLevel] >= 1)
        {
                GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
                switch(PlayerInfo[playerid][pAdminLevel])
                {
                    case 1: LevelName = "Moderator";
                    case 2: LevelName = "Administrator";
                    case 3: LevelName = "Senior Administrator";
                    case 4: LevelName = "Main Administrator";
                    case 5: LevelName = "Head Administrator";
                    case 6: LevelName = "Senior Head Administrator";
                    case 7: LevelName = "Trusted Administrator";
                    case 8: LevelName = "Owner";
                }
                strdel(text, 0, 1);
                format(string,sizeof(string),"[Admin Chat] %s %s: %s",LevelName,pname,text);
                SendClientMessageToAdmins(COLOR_BLUE,string);
        }
        else return 0;
        return 0;
    }
That's strdel for what you need. I don't know what you need strfind for.


Re: strfind,strdel [rep+] - xMichaelx - 08.12.2011

Thanks, i couldn't understand at first but after reading the strdel function it worked fine, thanks once again ******.