errors and warnings
#1

can someone fix this for me

Код:
C:\Users\Mo770711\Desktop\PayDay\pawno\include\YSI\y_hooks/impl.inc(1755) : warning 235: public function lacks forward declaration (symbol "OnUnoccupiedVehicleUpdate")
C:\Users\Mo770711\Desktop\PayDay\pawno\include\YSI\y_hooks/impl.inc(2336) : warning 235: public function lacks forward declaration (symbol "OnPlayerTakeDamage")
C:\Users\Mo770711\Desktop\PayDay\pawno\include\YSI\y_hooks/impl.inc(2383) : warning 235: public function lacks forward declaration (symbol "OnPlayerGiveDamage")
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(90) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(91) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(114) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(116) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(127) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(128) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(130) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(131) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(167) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(168) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(171) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(187) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(201) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(206) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(207) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(449) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(452) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(454) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(458) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(467) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(474) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(483) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(564) : error 017: undefined symbol "AttachCameraToObject"
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(580) : error 017: undefined symbol "AttachCameraToObject"
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(590) : warning 217: loose indentation
C:\Users\Mo770711\Desktop\PayDay\gamemodes\PayDay(beta).pwn(731) : error 030: compound statement not closed at the end of file (started at line 723)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
here is the code

Код:
//Pirates TDM by TonyII
//==========================[INCLUDES]=======================
#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
//==========================[COLORS]=========================
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREY 0xAFAFAFFF
#define COLOR_RED 0xFF0606FF
#define COLOR_BLUE 0x2641FEFF
//==========================[PATHS]==========================
#define PATH "/users/%s.ini"
//==========================[DIALOGS]========================
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_STYLE_PASSWORD 3
//==========================[TEAMS]==========================
#define TEAM_RED 1
#define TEAM_BLUE 2
//==========================[VARIABLES]======================
new Team[MAX_PLAYERS];
new Canon[MAX_PLAYERS];
new Float:OldHP[MAX_PLAYERS];
new ControllingRedShip[MAX_PLAYERS];
new ControllingBlueShip[MAX_PLAYERS];
new ShipRed;
new SailRed;
new FenceRed;
new ObjectRed;
new ShipBlue;
new SailBlue;
new FenceBlue;
new ObjectBlue;
new bCamera;
new rCamera;
//==========================[ENUMS]==========================
enum pInfo
{
        pCoins,
        pAdmin,
        pPass,
        pLevel,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
//==========================[MAIN]============================
main()
{
        print("\n----------------------------------");
        print("Pirate TDM by TonyII");
        print("----------------------------------\n");
}
//==========================[STOCKS]==========================
stock GPN(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    return name;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

stock udb_hash(buf[])
{
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
//==========================[PUBLICS]=========================
forward LoadUser_Data(playerid,name[],value[]);
public LoadUser_Data(playerid,name[],value[])
{
        INI_Int("Coins",PlayerInfo[playerid][pCoins]);
        INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
        INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Password",PlayerInfo[playerid][pPass]);
        return 1;
}

forward Kicked(playerid);
public Kicked(playerid)
{
        Kick(playerid);
        return 1;
}

forward Banned(playerid);
public Banned(playerid)
{
        Ban(playerid);
        return 1;
}

public OnGameModeInit()
{
        SetGameModeText("Pirates TDM v1.0");
        SendRconCommand("hostname [ENG]** Pirates TDM **");
        SendRconCommand("weburl www.sa-mp.com");
        SendRconCommand("mapname Ocean");
    AddPlayerClass(19,2431.3733,-1679.4271,13.7673,0,24,100,0,0,0,0); //RED
    AddPlayerClass(21,2167.8926,-1670.0753,15.0805,0,24,100,0,0,0,0); //BLUE
        DisableInteriorEnterExits();
        ObjectRed = CreateObject(8493,0,0,-100,0,0,0);
        FenceRed = CreateObject(9159,0,0,-100,0,0,0);
        SailRed = CreateObject(8981,0,0,-100,0,0,0);
        ShipRed = AddStaticVehicleEx(454, 105.6520, -3990.7867, -0.0164, 180.0000, -1, -1, -1);
        ObjectBlue = CreateObject(8493,0,0,-100,0,0,0);
        FenceBlue = CreateObject(9159,0,0,-100,0,0,0);
        SailBlue = CreateObject(8981,0,0,-100,0,0,0);
        ShipBlue = AddStaticVehicleEx(454, 133.6520, -3990.7867, -0.0164, 180.0000, -1, -1, -1);
        AttachObjectToVehicle(ObjectRed, ShipRed, 0.809999, 1.439998, 16.650209, 0.000000, 0.000000, 0.000000);
        AttachObjectToVehicle(SailRed, ShipRed, 0.294999, -4.665059, 16.250276, 0.000000, 0.000000, 0.000000);
    AttachObjectToVehicle(FenceRed, ShipRed, 0.784999, 1.439998, 16.655208, 0.000000, 0.000000, 0.000000);
        AttachObjectToVehicle(ObjectBlue, ShipBlue, 0.809999, 1.439998, 16.650209, 0.000000, 0.000000, 0.000000);
        AttachObjectToVehicle(SailBlue, ShipBlue, 0.294999, -4.665059, 16.250276, 0.000000, 0.000000, 0.000000);
    AttachObjectToVehicle(FenceBlue, ShipBlue, 0.784999, 1.439998, 16.655208, 0.000000, 0.000000, 0.000000);
        LinkVehicleToInterior(ShipRed,1);
        LinkVehicleToInterior(ShipBlue,1);
        SetVehicleHealth(ShipRed,999999);
        SetVehicleHealth(ShipBlue,999999);
        return 1;
}

public OnGameModeExit()
{
        return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
        if(!success)
        SendClientMessage(playerid,COLOR_BLUE, "[P:TDM]{AFAFAF} Unknown command.");
        return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
            GameTextForPlayer(playerid,"~r~TEAM RED",300,3);
            SetPlayerColor(playerid,COLOR_RED);
            Team[playerid] = TEAM_RED;
        }
        case 1:
        {
            GameTextForPlayer(playerid,"~b~TEAM BLUE",300,3);
            SetPlayerColor(playerid,COLOR_BLUE);
            Team[playerid] = TEAM_BLUE;
        }
        }
        SetPlayerPos(playerid, 546.3170,-1905.5155,1.4745);
    SetPlayerFacingAngle(playerid,4);
    SetPlayerCameraPos(playerid, 546.3170,-1905.5155,1.4745);
    SetPlayerCameraLookAt(playerid, 546.3170,-1905.5155,1.4745);
        return 1;
}

public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
        {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        TogglePlayerSpectating(playerid,1);
        ShowPlayerDialog(playerid,DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Login","{FFFFFF}Welcome to {FF8000}Pirates Team Deathmatch\n{FFFFFF}Type your {00FF00}password {FFFFFF}below to login.", "Login", "Quit");
        }
        else
        {
        TogglePlayerSpectating(playerid,1);
        ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{FFFFFF}Register.","{FFFFFF}Welcome to {FF8000}Pirates Team Deathmatch\n{FFFFFF}Type your {00FF00}password {FFFFFF}below to register a new account.","Register","Quit");
        }
        SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
        new plname[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, plname, sizeof(plname));
        PlayerInfo[playerid][pAdmin] = 0;
        PlayerInfo[playerid][pLevel] = 0;
        PlayerInfo[playerid][pCoins] = 0;
        format(string, sizeof(string), "/users/%s.ini", plname);
        return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    ControllingRedShip[playerid] = 0;
    ControllingBlueShip[playerid] = 0;
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"Data");
        INI_WriteInt(File,"Coins",PlayerInfo[playerid][pCoins]);
        INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
        INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
    INI_Close(File);
        return 1;
}

public OnPlayerSpawn(playerid)
{
        if(Team[playerid] == TEAM_RED)
        {
        SetPlayerSkin(playerid,19);
        }
        else
        {
        SetPlayerSkin(playerid,21);
        }
        return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
        if(Team[playerid] == Team[killerid])
        {
        SendClientMessage(playerid,COLOR_ORANGE,"You've lost 75 coins and 2 levels for killing your teammate!");
        PlayerInfo[killerid][pLevel] -= 2;
        SetPlayerScore(killerid,PlayerInfo[killerid][pLevel]);
        PlayerInfo[killerid][pCoins] -= 75;
        GivePlayerMoney(killerid,-75);
        }
        else
        {
        PlayerInfo[killerid][pLevel] ++;
        SetPlayerScore(killerid,PlayerInfo[killerid][pLevel]);
        PlayerInfo[killerid][pCoins] += 50;
        GivePlayerMoney(killerid,50);
        }
        new Float:X,Float:Y,Float:Z;
        if(Team[playerid] == TEAM_RED)
        {
        GetVehiclePos(ShipRed,X,Y,Z);
        SetSpawnInfo(playerid,19,0,X,Y+2,Z+6,0,26,50,33,100,8,1);
        SpawnPlayer(playerid);
        }
        else
        {
        GetVehiclePos(ShipBlue,X,Y,Z);
        SetSpawnInfo(playerid,21,0,X,Y+2,Z+6,0,26,50,33,100,8,1);
        SpawnPlayer(playerid);
        }
        SendDeathMessage(killerid, playerid, reason);
        return 1;
}

public OnVehicleSpawn(vehicleid)
{
        return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
        return 1;
}

public OnPlayerText(playerid, text[])
{
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/mycommand", cmdtext, true, 10) == 0)
        {
                // Do something here
                return 1;
        }
        return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
        return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
        return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
        return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
        return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
        return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
        return 1;
}

public OnRconCommand(cmd[])
{
        return 1;
}

public OnPlayerRequestSpawn(playerid)
{
        new Float:X,Float:Y,Float:Z;
        if(Team[playerid] == TEAM_RED)
        {
        GetVehiclePos(ShipRed,X,Y,Z);
        SetSpawnInfo(playerid,19,0,X,Y+2,Z+6,0,26,50,33,100,8,1);
        SpawnPlayer(playerid);
        }
        else
        {
        GetVehiclePos(ShipBlue,X,Y,Z);
        SetSpawnInfo(playerid,21,0,X,Y+2,Z+6,0,26,50,33,100,8,1);
        SpawnPlayer(playerid);
        }
        return 1;
}

public OnObjectMoved(objectid)
{
        return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
        return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
        return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
        return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
        return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
        return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
        return 1;
}

public OnPlayerExitedMenu(playerid)
{
        return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
        return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        new Float:X,Float:Y,Float:Z;
        if (newkeys & KEY_SECONDARY_ATTACK)
        {
                if(Team[playerid] == TEAM_BLUE || ControllingBlueShip[playerid] == 1)
                {
                ControllingBlueShip[playerid] = 0;
                RemovePlayerFromVehicle(playerid);
                GetPlayerPos(playerid, X,Y,Z);
                SetPlayerPos(playerid, X,Y+2,Z+6);
                SetCameraBehindPlayer(playerid);
                DestroyObject(bCamera);
                SetPlayerHealth(playerid,OldHP[playerid]);
                }
                else if(Team[playerid] == TEAM_RED || ControllingRedShip[playerid] == 1)
                {
                ControllingRedShip[playerid] = 0;
                RemovePlayerFromVehicle(playerid);
                GetPlayerPos(playerid, X,Y,Z);
                SetPlayerPos(playerid, X,Y+2,Z+6);
                SetCameraBehindPlayer(playerid);
                DestroyObject(rCamera);
                SetPlayerHealth(playerid,OldHP[playerid]);
                }
        }
        return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
        return 1;
}

public OnPlayerUpdate(playerid)
{
        return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
        return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
        return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
        return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
        return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == DIALOG_REGISTER)
        {
        if(!response) return Kick(playerid);
    if(response)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register.","{FF8000}Pirates Team Deathmatch\n{FF0000}You have entered an invalid password.\n{FFFFFF}Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"Data");
        INI_WriteInt(File,"Password",udb_hash(inputtext));
        INI_WriteInt(File,"Coins",0);
        INI_WriteInt(File,"Admin",0);
        INI_WriteInt(File,"Level",0);
                INI_Close(File);
                TogglePlayerSpectating(playerid,0);
                TogglePlayerControllable(playerid,1);
                ForceClassSelection(playerid);
        }
        }
        if(dialogid == DIALOG_LOGIN)
        {
        if(!response) return Kick (playerid);
    if(response)
    {
        if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
        {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
        GivePlayerMoney(playerid, PlayerInfo[playerid][pCoins]);
                TogglePlayerSpectating(playerid,0);
                TogglePlayerControllable(playerid,1);
                ForceClassSelection(playerid);
                }
                else
        {
        ShowPlayerDialog(playerid,DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Login","{FF8000}Pirates Team Deathmatch\n{FF0000}Incorrect password.\n{FFFFFF}Type your {00FF00}password {FFFFFF}below to login.","Login","Quit");
        TogglePlayerSpectating(playerid,1);
                }
                return 1;
        }
    }
        return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
        return 1;
}

CMD:help(playerid,params[])
{
        SendClientMessage(playerid,COLOR_WHITE,"Available commands.");
        SendClientMessage(playerid,COLOR_WHITE,"/swapteams - /suicide - /report - /buymolotovcocktails - /buycanonball - /firecanon - /commandship");
        return 1;
}

CMD:suicide(playerid, params[])
{
        if(ControllingRedShip[playerid] == 1 || ControllingBlueShip[playerid] == 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You can't do this right now.");
        SetPlayerHealth(playerid,0);
        return 1;
}

CMD:buycanonball(playerid,params[])
{
        if(Canon[playerid] == 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You already have a canon.");
        if(GetPlayerMoney(playerid) <= 500) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} Insufficient funds. [500 coins]");
        Canon[playerid] = 1;
        PlayerInfo[playerid][pCoins] -= 500;
        GivePlayerMoney(playerid, -500);
        SendClientMessage(playerid,COLOR_ORANGE,"You've successfully purchased a canon, /firecanon.");
        return 1;
}

CMD:buymolotovcocktails(playerid,params[])
{
        if(GetPlayerMoney(playerid) <= 1000) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} Insufficient funds. [1000 coins]");
        PlayerInfo[playerid][pCoins] -= 1000;
        GivePlayerMoney(playerid, -1000);
        GivePlayerWeapon(playerid,18,5);
        SendClientMessage(playerid,COLOR_ORANGE,"You've successfully purchased molotov cocktails.");
        return 1;
}


CMD:firecanon(playerid,params[])
{
        new Float:X,Float:Y,Float:Z;
        if(Canon[playerid] == 0) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You don't have a canon.");
        if(Team[playerid] == TEAM_RED)
        {
        GetVehiclePos(ShipBlue,X,Y,Z);
        CreateExplosion(X,Y,Z,7,10);
        Canon[playerid] = 0;
        }
        else
        {
        GetVehiclePos(ShipRed,X,Y,Z);
        CreateExplosion(X,Y,Z,7,10);
        Canon[playerid] = 0;
        }
        return 1;
}

CMD:commandship(playerid, params[])
{
        new Float:HP;
        if(Team[playerid] == TEAM_BLUE)
        {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(ControllingBlueShip[i] == 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} The ship is being held in command by someone else.");
        }
        GetPlayerHealth(playerid, HP);
        OldHP[playerid] = HP;
        SetPlayerHealth(playerid,99999);
        bCamera = CreateObject(0, 0,0,0,0,0,0);
        AttachObjectToVehicle(bCamera, ShipBlue,0,-35,23,0.000000,0.000000,0.0);
        PutPlayerInVehicle(playerid, ShipBlue, 0);
        AttachCameraToObject(playerid, bCamera);
        ControllingBlueShip[playerid] = 1;
        SendClientMessage(playerid, -1,"Type /quitship or press 'F' if you want to stop commanding this ship.");
        }
        else if(Team[playerid] == TEAM_RED)
        {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(ControllingRedShip[i] == 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} The ship is being held in command by someone else.");
        }
        GetPlayerHealth(playerid, HP);
        OldHP[playerid] = HP;
        SetPlayerHealth(playerid,99999);
        rCamera = CreateObject(0, 0,0,0,0,0,0);
        AttachObjectToVehicle(rCamera, ShipRed,0,-35,23,0.000000,0.000000,0.0);
        PutPlayerInVehicle(playerid, ShipRed, 0);
        AttachCameraToObject(playerid, rCamera);
        ControllingRedShip[playerid] = 1;
        SendClientMessage(playerid, -1,"Type /quitship or press 'F' if you want to stop commanding this ship.");
        }
        return 1;
}

CMD:quitship(playerid, params[])
{
    new Float:X,Float:Y,Float:Z;
        if(Team[playerid] == TEAM_BLUE || ControllingBlueShip[playerid] == 1)
        {
        ControllingBlueShip[playerid] = 0;
        RemovePlayerFromVehicle(playerid);
        GetPlayerPos(playerid, X,Y,Z);
        SetPlayerPos(playerid, X,Y+2,Z+6);
        SetCameraBehindPlayer(playerid);
        DestroyObject(bCamera);
        SetPlayerHealth(playerid,OldHP[playerid]);
        }
        else if(Team[playerid] == TEAM_RED || ControllingRedShip[playerid] == 1)
        {
        ControllingRedShip[playerid] = 0;
        RemovePlayerFromVehicle(playerid);
        GetPlayerPos(playerid, X,Y,Z);
        SetPlayerPos(playerid, X,Y+2,Z+6);
        SetCameraBehindPlayer(playerid);
        DestroyObject(rCamera);
        SetPlayerHealth(playerid,OldHP[playerid]);
        }
        return 1;
}

CMD:swapteams(playerid, params[])
{
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
        return 1;
}

//Admin commands.
//=========================================================================================================================================
CMD:adminhelp(playerid, params[])
{
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        SendClientMessage(playerid,COLOR_WHITE,"LEVEL 1: /kick - /ban");
        SendClientMessage(playerid,COLOR_WHITE,"LEVEL 2: /setstats - /givecanonball");
        SendClientMessage(playerid,COLOR_WHITE,"LEVEL 3: /makeadmin - /fireadmin");
        return 1;
}

CMD:makeadmin(playerid, params[])
{
        new playerb,level;
        if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
        {
        if(sscanf(params,"ui",playerb,level)) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} /makeadmin [playerid] [level]");
        new string[128];
        PlayerInfo[playerb][pAdmin] = level;
        format(string,sizeof(string),"Admin %s has promoted you to a level %d admin.",GPN(playerid),level);
        SendClientMessage(playerb,COLOR_WHITE,string);
        format(string,sizeof(string),"You've promoted %s to a level %d admin",GPN(playerb),level);
        SendClientMessage(playerid,COLOR_WHITE,string);
        }
        else return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        return 1;
}

CMD:setstats(playerid, params[])
{
        new playerb,choice,amount,string[128];
        if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        if(sscanf(params, "uii", playerb,choice,amount))
        {
                SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} /setstats [playerid] [choice] [amount]");
                SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} 1|Level 2|Coins");
                return 1;
        }
        switch(choice)
        {
                case 1:
                {
                        PlayerInfo[playerb][pLevel] = amount;
                        SetPlayerScore(playerb,PlayerInfo[playerb][pLevel]);
                        format(string, sizeof(string), "You've set %s's level to %d.",GPN(playerb),amount);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Admin %s has set your level to %d.",GPN(playerid),amount);
                        SendClientMessage(playerb, COLOR_WHITE, string);
                }
                case 2:
                {
                        PlayerInfo[playerb][pCoins] = amount;
                        ResetPlayerMoney(playerb);
                        GivePlayerMoney(playerb,PlayerInfo[playerb][pCoins]);
                        format(string, sizeof(string), "You've set %s's coins to %d.",GPN(playerb),amount);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Admin %s has set your coins to %d.",GPN(playerid),amount);
                        SendClientMessage(playerb, COLOR_WHITE, string);
                }
        }
        return 1;
}

CMD:givecanonball(playerid, params[])
{
        new playerb,string[128];
        if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} /givecanon [playerid]");
        Canon[playerb] = 1;
        format(string, sizeof(string), "You've given %s a canonball.",GPN(playerb));
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "Admin %s has given you a canonball.",GPN(playerid));
        SendClientMessage(playerb, COLOR_WHITE, string);
        return 1;
}

CMD:givemolotovcocktails(playerid, params[])
{
        new playerb,string[128];
        if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} /givemolotovcoktails [playerid]");
        GivePlayerWeapon(playerid,18,5);
        format(string, sizeof(string), "You've given %s molotov cocktails.",GPN(playerb));
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "Admin %s has given you molotov cocktails.",GPN(playerid));
        SendClientMessage(playerb, COLOR_WHITE, string);
        return 1;
}

CMD:kick(playerid, params[])
{
        new playerb,string[128];
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} /kick [playerid]");
        if(PlayerInfo[playerb][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} You can't kick a admin with higher level then you.");
        SetTimerEx("Kicked",1000,false,"i",playerb);
        format(string, sizeof(string), "Admin %s kicked %s from the server.",GPN(playerid),GPN(playerb));
        SendClientMessageToAll(COLOR_ORANGE,string);
        return 1;
}

CMD:ban(playerid, params[])
{
        new playerb,string[128];
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_BLUE,"[P:TDM]{AFAFAF} You aren't authorized to use this command.");
        if(sscanf(params,"u",playerb)) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} /ban [playerid]");
        if(PlayerInfo[playerb][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_BLUE,"[P:TDM]{AFAFAF} You can't ban a admin with higher level then you.");
        SetTimerEx("Banned",1000,false,"i",playerb);
        format(string, sizeof(string), "Admin %s banned %s from the server.",GPN(playerid),GPN(playerb));
        SendClientMessageToAll(COLOR_ORANGE,string);
        return 1;
Reply
#2

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)