Saving String
#5

pawn Код:
CMD:admins(playerid, params[])
{
    new
        string[50];
       
    SendClientMessage(playerid, COLOR_GREY, "Admins online:");
    foreach(Player, i)
    {
        if(IsPlayerConnected(i))
        {
            if(pInfo[i][pAdmin] >= 1)
            {
                if(pInfo[i][pDuty] == true)
                {

                        format(string, sizeof(string),"(ID: %d) %s(Admin level: %d)", i, PlayerName(i), pInfo[i][pAdmin]);
                        SendClientMessage(playerid, COLOR_ORANGE, string);
                   
                }
               
                else
                {

                        format(string, sizeof(string),"(ID: %d) %s (Admin level: %d)", i, PlayerName(i), pInfo[i][pAdmin]);
                        SendClientMessage(playerid, COLOR_GREY, string);

                }
            }
        }
    }
    return 1;
}
that is my admins command, and I want new command /myname and when I type /myname [my forum name] that shows into /admins, I gues you understand it now..but I dont know how to make a command, I made it couple months ago with format, but that is slow as hell,


pawn Код:
CMD:myname(playerid, params[]) // ne radi
{

    if(pInfo[playerid][pAdmin] < 1)
        return SendClientMessage(playerid, COLOR_RED, "No permission.");
       
    if(isnull(params))
        return SendClientMessage(playerid, -1, "Usage: /myname [your name]");
       
    strcpy(pInfo[playerid][pAdminName], params, 10);
   
       
    return 1;
       
   
}
that command I tried but doesn't work.


That /admins command is withouth this /myname stuff..
Reply


Messages In This Thread
Saving String - by 025Tadija - 24.06.2015, 14:47
Re : Saving String - by Dutheil - 24.06.2015, 14:54
Re : Saving String - by KillerDVX - 24.06.2015, 14:58
Re: Saving String - by Darkwood17 - 24.06.2015, 15:02
Re: Saving String - by 025Tadija - 24.06.2015, 15:13
Re : Saving String - by KillerDVX - 24.06.2015, 15:14
Re: Saving String - by 025Tadija - 24.06.2015, 15:19
Re: Saving String - by Konstantinos - 24.06.2015, 15:26
Re : Saving String - by KillerDVX - 24.06.2015, 15:32
Re: Saving String - by 025Tadija - 24.06.2015, 15:32

Forum Jump:


Users browsing this thread: 1 Guest(s)