Help with command
#1

Hello,
I need to ask you a question!
I want to add a command like /changeprefix <prefix>, who changed your prefix to what you wrote in <prefix>
I found some code but i cant make to FS..
Here is a code:

PHP код:
if(strcmp(cmd"/changeprefix"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if (
logged[playerid] == 1)
            {
                if(
pInfo[playerid][PREFIXlevel] > ) {
                new 
length strlen(cmdtext);
                while ((
idx length) && (cmdtext[idx] <= ' '))
                {
                    
idx++;
                }
                new 
offset idx;
                new 
result[256];
                while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                {
                    
result[idx offset] = cmdtext[idx];
                    
idx++;
                }
                
result[idx offset] = EOS;
                if(!
strlen(result))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"Използвай: /changeprefix [Prefix]");
                    return 
1;
                }
                if(
strfindresult "," true ) == -1)
                {
                       
strmid(pInfo[playerid][Prefix], (result), 0strlen((result)), 129);
                    
format(stringsizeof(string), "{FFFFFF}Ти смени своя префикс на: {9AFF00}%s{FFFFFF}.", (result));
                    
SendClientMessage(playeridCOLOR_YELLOWstring);
                }
                }
                else
                {
                   
SendClientMessage(playeridCOLOR_RED,"Нямаш необходимия левел, за да сменяш префикса си.");
                }
            }
        }
        return 
1;
    } 
If this code have a problems pls fix it, im new in pwn so can i ask you to place the .pwn! Please.
And, can only ppls with rcon have permission to use it!
Reply


Messages In This Thread
Help with command - by Mazda48 - 16.11.2016, 13:34
Re: Help with command - by TwinkiDaBoss - 16.11.2016, 15:33
Re: Help with command - by Mazda48 - 16.11.2016, 17:12
Re: Help with command - by Mazda48 - 18.11.2016, 10:41
Re: Help with command - by aymane123 - 18.11.2016, 10:57
Re: Help with command - by Mazda48 - 19.11.2016, 09:28

Forum Jump:


Users browsing this thread: 4 Guest(s)