Script Problem
#1

Hi i would make my admin sys and it's the code of samp tutorial but i would use ZCMD.
and i would make other level with cmd.

Код:
CMD:setadmin(playerid,params[])
{
       new string[128];
       new tmp[256];
       new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
       new giveplayerid;
       if (IsPlayerAdmin(playerid))
       {
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                       SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin [playerid] [level]");
                       SendClientMessage(playerid, COLOR_WHITE, "FUNCTION: Player will be an admin.");
                       return 1;
               }
               giveplayerid = ReturnUser(tmp);
               tmp = strtok(cmdtext, idx);
               new level = strval(tmp);
               if(giveplayerid != INVALID_PLAYER_ID)
               {
                       GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                       GetPlayerName(playerid, player, sizeof(player));
                       PlayerInfo[giveplayerid][AdminLevel] = level;
                       printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
                       format(string, sizeof(string), "You have been made Administrator level %d by %s.", level,  player);
                       SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                       format(string, sizeof(string), "You have set the administrator level %d to %s.",  giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
                               SendClientMessage(playerid, 0x00C2ECFF, string);
               }
               else if(giveplayerid == INVALID_PLAYER_ID)
               {
                       format(string, sizeof(string), "%i is not online.", giveplayerid);
                       SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
               }
       }
       else
       {
           SendClientMessage(playerid, 0xE60000FF, "You are not a  Management!");
       }
       return 1;
}
Reply
#2

I give +1 in rep if you help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)