Help, Failing beginner....
#5

pawn Код:
if(strcmp("/makecaptain", cmdtext, true) == 0)
{
    new targetid;
    if(IsPlayerConnected(targetid))
    {
        if(IsPlayerAdmin(playerid))
        {
            new pSkin;
            pSkin = GetPlayerSkin(playerid);
           
            if(pSkin == 255))
            {
                new string[128]; // Make sure your strings are ALWAYS no higher than 128 cells
                new sendername2[MAX_PLAYER_NAME];
                GetPlayerName(playerid, string, sendername2);
                format(string, sizeof(string),"%s has made you a Captain, Don't abuse this position!", sendername2);
                SetPlayerTeam(targetid, 0);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WRONG, "You are not an admin!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_WRONG, "Player Not Connected!");
    }
    return 1;
}
See if that works, also, if you're wanting to create any decent piece of code, you should consider using proper indentation
Reply


Messages In This Thread
Help, Failing beginner.... - by Brunok - 18.07.2011, 14:46
Re: Help, Failing beginner.... - by Brunok - 18.07.2011, 15:24
Re: Help, Failing beginner.... - by Famalamalam - 18.07.2011, 15:27
Re: Help, Failing beginner.... - by Brunok - 18.07.2011, 15:35
Re: Help, Failing beginner.... - by Famalamalam - 18.07.2011, 15:42
Re: Help, Failing beginner.... - by Brunok - 18.07.2011, 15:55
Re: Help, Failing beginner.... - by Famalamalam - 18.07.2011, 15:57
Re: Help, Failing beginner.... - by Brunok - 18.07.2011, 16:01
Re: Help, Failing beginner.... - by Famalamalam - 18.07.2011, 16:04
Re: Help, Failing beginner.... - by Brunok - 18.07.2011, 16:07

Forum Jump:


Users browsing this thread: 2 Guest(s)