strfind,strdel [rep+]
#1

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
Reply
#2

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.
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)