#1

PHP код:
if(strcmp(cmd"/makeadmin"true) == 0)
{
       new 
string[128];
       new 
tmp[256];
       new 
player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
       new 
giveplayerid;
       if (
IsPlayerAdmin(playerid))
       {
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                       
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /makeadmin [playerid] [level]");
                       
SendClientMessage(playeridCOLOUR_ORANGE"FUNCTION: Player will be an admin.");
                       return 
1;
               }
               
giveplayerid ReturnUser(tmp);
               
tmp strtok(cmdtextidx);
               new 
level strval(tmp);
               if(
giveplayerid != INVALID_PLAYER_ID)
               {
                       
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                       
GetPlayerName(playeridplayersizeof(player));
                       
PlayerInfo[giveplayerid][pAdminLevel] = level;
                       
printf("Admin %s made %s a level %d admin."playergiveplayerlevel);
                       
format(stringsizeof(string), "You are now an administrator level %d thanks to %s."level,  player);
                       
SendClientMessage(giveplayerid0x00C2ECFFstring);
                       
format(stringsizeof(string), "You have given %s level %d admin.",  giveplayer,PlayerInfo[giveplayerid][pAdminLevel]);
                               
SendClientMessage(playerid0x00C2ECFFstring);
               }
               else if(
giveplayerid == INVALID_PLAYER_ID)
               {
                       
format(stringsizeof(string), "%i is not an active player."giveplayerid);
                       
SendClientMessage(playerid0xE60000FFstring);
               }
       }
       else
       {
           
SendClientMessage(playerid0xE60000FF"You are not a lead admin!");
       }
       return 
1;

errors:
PHP код:
D:\gta san andreas online\Godfucker\My Fs\Register System Dialog\Register_Dialog.pwn(114) : error 017undefined symbol "ReturnUser"
D:\gta san andreas online\Godfucker\My Fs\Register System Dialog\Register_Dialog.pwn(126) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

Reply
#2

i solved it!!! thx anyway...
Quote:
Originally Posted by omer5198
Посмотреть сообщение
PHP код:
if(strcmp(cmd"/makeadmin"true) == 0)
{
       new 
string[128];
       new 
tmp[256];
       new 
player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
       new 
giveplayerid;
       if (
IsPlayerAdmin(playerid))
       {
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                       
SendClientMessage(playeridCOLOUR_ORANGE"USAGE: /makeadmin [playerid] [level]");
                       
SendClientMessage(playeridCOLOUR_ORANGE"FUNCTION: Player will be an admin.");
                       return 
1;
               }
               
giveplayerid ReturnUser(tmp);
               
tmp strtok(cmdtextidx);
               new 
level strval(tmp);
               if(
giveplayerid != INVALID_PLAYER_ID)
               {
                       
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                       
GetPlayerName(playeridplayersizeof(player));
                       
PlayerInfo[giveplayerid][pAdminLevel] = level;
                       
printf("Admin %s made %s a level %d admin."playergiveplayerlevel);
                       
format(stringsizeof(string), "You are now an administrator level %d thanks to %s."level,  player);
                       
SendClientMessage(giveplayerid0x00C2ECFFstring);
                       
format(stringsizeof(string), "You have given %s level %d admin.",  giveplayer,PlayerInfo[giveplayerid][pAdminLevel]);
                               
SendClientMessage(playerid0x00C2ECFFstring);
               }
               else if(
giveplayerid == INVALID_PLAYER_ID)
               {
                       
format(stringsizeof(string), "%i is not an active player."giveplayerid);
                       
SendClientMessage(playerid0xE60000FFstring);
               }
       }
       else
       {
           
SendClientMessage(playerid0xE60000FF"You are not a lead admin!");
       }
       return 
1;

errors:
PHP код:
D:\gta san andreas online\Godfucker\My Fs\Register System Dialog\Register_Dialog.pwn(114) : error 017undefined symbol "ReturnUser"
D:\gta san andreas online\Godfucker\My Fs\Register System Dialog\Register_Dialog.pwn(126) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

Reply
#3

Try This mean:P
pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Use: /makeadmin [PlayerID] [level(1-1340)]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pAdmin] = level;
                        printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   You have been promoted to a level %d admin by %s", level, sendername);
                        SendClientMessage(para1, COLOR_WHITE, string);
                        format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not admin!");
            }
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)