Strcmp:makeadmin problem.
#7

Quote:
Originally Posted by Cxnnor
Посмотреть сообщение
Yup, and it worked, now I only have these errors.

Код:
C:\Users\Connor\Desktop\Development\0.3E - SCRIPT\gamemodes\AGS.pwn(654) : error 017: undefined symbol "Player"
C:\Users\Connor\Desktop\Development\0.3E - SCRIPT\gamemodes\AGS.pwn(654) : warning 215: expression has no effect
C:\Users\Connor\Desktop\Development\0.3E - SCRIPT\gamemodes\AGS.pwn(654) : error 001: expected token: ";", but found "]"
C:\Users\Connor\Desktop\Development\0.3E - SCRIPT\gamemodes\AGS.pwn(654) : error 029: invalid expression, assumed zero
C:\Users\Connor\Desktop\Development\0.3E - SCRIPT\gamemodes\AGS.pwn(654) : fatal error 107: too many error messages on one line
pawn Код:
#include <a_samp>

enum pData
{
      AdminLevel,
}
new PlayerData[MAX_PLAYERS][pData];

    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmdtext, "/makeadmin",true)) // 648
    {
       new string[128];
       new tmp[256];
       new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
       new giveplayerid;
       if(pData[playerid][AdminLevel] >= 6); // 654
       {
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                       SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid] [level]");
                       SendClientMessage(playerid, COLOR_GREY, "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 are now an administrator level %d.", level,  player);
                       SendClientMessage(giveplayerid, COLOR_GREY, string);
                       format(string, sizeof(string), "You have given %s level %d admin.",  giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
                               SendClientMessage(playerid, COLOR_GREY, string);
               }
               else if(giveplayerid == INVALID_PLAYER_ID)
               {
                       format(string, sizeof(string), "%i is not an active player.", giveplayerid);
                       SendClientMessage(playerid, COLOR_GREY, string);
               }
       }
       else
       {
           SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
       }
       return 1;
    }
try this Cxnnor
Reply


Messages In This Thread
Strcmp:makeadmin problem. - by Cxnnor - 24.07.2012, 09:37
Re: Strcmp:makeadmin problem. - by Devilxz97 - 24.07.2012, 09:45
Re: Strcmp:makeadmin problem. - by Rudy_ - 24.07.2012, 09:48
Re: Strcmp:makeadmin problem. - by Cxnnor - 24.07.2012, 09:49
Re: Strcmp:makeadmin problem. - by Devilxz97 - 24.07.2012, 09:50
Re: Strcmp:makeadmin problem. - by Cxnnor - 24.07.2012, 09:55
Re: Strcmp:makeadmin problem. - by Devilxz97 - 24.07.2012, 09:57
Re: Strcmp:makeadmin problem. - by Cxnnor - 24.07.2012, 10:02
Re: Strcmp:makeadmin problem. - by Cxnnor - 24.07.2012, 10:29
Re: Strcmp:makeadmin problem. - by Devilxz97 - 24.07.2012, 10:32

Forum Jump:


Users browsing this thread: 2 Guest(s)