Few problems
#2

pawn Код:
CMD:setadmin(playerid, params[])
{
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 9)
            {
                new sendername[MAX_PLAYER_NAME];
                new giveplayername[MAX_PLAYER_NAME];
                new giveplayerid,level;
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                if (!sscanf(params, "ui", giveplayerid,level)) //u = username.
                {
                    if (giveplayerid != INVALID_PLAYER_ID)
                        {
                                new string[128];
                                format(string, sizeof(string), "The admin %s has made you a level %d admin",sendername,level);
                                        SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                                        format(string, sizeof(string), "You have made %s a level %d admin",giveplayername,level);
                                        SendClientMessage(playerid, COLOR_YELLOW, string);
                                        PlayerInfo[giveplayerid][Admin] = level;
                                }
                        }
                        else SendClientMessage(playerid, COLOR_GREY, "SYNTAX:/setadmin [playerid] [level]");
                }
                else SendClientMessage(playerid, COLOR_RED1, "You are not a Community Staff Member! Or Your Level is too low!");
        }
        return 1;
}
You're missing an ; at the end of your code.

pawn Код:
CMD:ask(playerid, params[])
{
       new question[128], pname[24];
       if(sscanf(params, "s[128]", question))
       {
                SendClientMessage(playerid, COLOR_GREY, "SYNTAX:/ask <question>");
       }
       else
       {
               GetPlayerName(playerid, pname, 24);
               for(new i = 0; i<MAX_PLAYERS; i++)
               {
                      if(IsPlayerConnected(i) && IsPlayerAdmin(i))
                      {
                              new str[128];
                              format(str, sizeof(str), "Question From %s(%d) : %s", pname, playerid, question); //<----- here
                              SendClientMessage(i, COLOR_LEMON, str);
                      }
                }
         }
        return 1;
}
Try changing 'z' to s[35] for a string.
pawn Код:
CMD:kick(playerid,params[])
    {
        if(PlayerInfo[playerid][Admin] >=2)
        {
            new id,n[MAX_PLAYER_NAME],reason[35], on[MAX_PLAYER_NAME], string[128], string2[128];
            if(sscanf(params,"us[35]",id, reason)) return SendClientMessage(playerid,COLOR_GREY,"SYNTAX:/kick [ID] [reason]"); //here
            else if(playerid == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_YELLOW,"Player not found");
            else
            {
            GetPlayerName(playerid,n,sizeof(n));
            GetPlayerName(id,on,sizeof(on));
            format(string,sizeof(string),"You have been kicked by Admin: %s for: %s",n,reason);
            SendClientMessage(playerid,COLOR_RED,string);
            format(string2, sizeof(string), "Admin Action: %s has kicked %s for: %s",n,on,reason);
            SendClientMessageToAll(COLOR_RED,string2);
            Kick(id);
            }
        }
        else return SendClientMessage(playerid,COLOR_RED1, "You are not a Community Staff Member! Or Your Level is too low!");
        return 1;
    }
Reply


Messages In This Thread
Few problems - by Tachibana - 21.06.2011, 22:49
Re: Few problems - by Haydz - 21.06.2011, 23:37
Re: Few problems - by Tachibana - 21.06.2011, 23:55

Forum Jump:


Users browsing this thread: 2 Guest(s)