Errors
#1

Code
pawn Код:
//===========================================================//
//====================== eXtreme freeroam v1.0 ==============//
//===========================================================//

/*========= FEATURES ==========//
-Admin Commands
-Saving of stats using Y_INI
-Plenty of Pickups
-A lot of vehicles
-And more!
*/


/*//////////
Planned in v1.2:
-A VIP System
-Fixes on Bugs in this version (If possible)
*/
//////////

#include <a_samp>
#include <YSI\y_ini>
#include <irc>
#include <Ranks>


/////////// IRC Settings ///////
#define IRC_SERVER "irc.mibbi.net" //Change to yours. For example, irc.mibbit.com
#define IRC_PORT (6667) //Your IRC Port. It is usually what the default is (6667)
#define IRC_CHANNEL "#FR4Life" //Your channel. For example, #ExtremeFreeroam

#define BOT_1_NICKNAME "Announcer"
#define BOT_1_REALNAME "SA-MP Bot"
#define BOT_1_USERNAME "Announcer_Bot"

#define MAX_BOTS (1)

new gBotID[MAX_BOTS], gGroupID;

//Spawns
//eXtreme freeroam spawns
//Credits to Grand Larceny

new Float:gRandomSpawns[][4] = {
{1751.1097,-2106.4529,13.5469,183.1979}, // El-Corona - Outside random house
{2652.6418,-1989.9175,13.9988,182.7107}, // Random house in willowfield - near playa de seville and stadium
{2489.5225,-1957.9258,13.5881,2.3440}, // Hotel in willowfield - near cluckin bell
{2689.5203,-1695.9354,10.0517,39.5312}, // Outside stadium - lots of cars
{2770.5393,-1628.3069,12.1775,4.9637}, // South in east beach - north of stadium - carparks nearby
{2807.9282,-1176.8883,25.3805,173.6018}, // North in east beach - near apartments
{2552.5417,-958.0850,82.6345,280.2542}, // Random house north of Las Colinas
{2232.1309,-1159.5679,25.8906,103.2939}, // Jefferson motel
{2388.1003,-1279.8933,25.1291,94.3321}, // House south of pig pen
{2481.1885,-1536.7186,24.1467,273.4944}, // East LS - near clucking bell and car wash
{2495.0720,-1687.5278,13.5150,359.6696}, // Outside CJ's house - lots of cars nearby
{2306.8252,-1675.4340,13.9221,2.6271}, // House in ganton - lots of cars nearby
{2191.8403,-1455.8251,25.5391,267.9925}, // House in south jefferson - lots of cars nearby
{1830.1359,-1092.1849,23.8656,94.0113}, // Mulholland intersection carpark
{2015.3630,-1717.2535,13.5547,93.3655}, // Idlewood house
{1654.7091,-1656.8516,22.5156,177.9729}, // Right next to PD
{1219.0851,-1812.8058,16.5938,190.0045}, // Conference Center
{1508.6849,-1059.0846,25.0625,1.8058}, // Across the street of BANK - lots of cars in intersection carpark
{1421.0819,-885.3383,50.6531,3.6516}, // Outside house in vinewood
{1133.8237,-1272.1558,13.5469,192.4113}, // Near hospital
{1235.2196,-1608.6111,13.5469,181.2655}, // Backalley west of mainstreet
{590.4648,-1252.2269,18.2116,25.0473}, // Outside "BAnk of San Andreas"
{842.5260,-1007.7679,28.4185,213.9953}, // North of Graveyard
{911.9332,-1232.6490,16.9766,5.2999}, // LS Film Studio
{477.6021,-1496.6207,20.4345,266.9252}, // Rodeo Place
{255.4621,-1366.3256,53.1094,312.0852}, // Outside propery in richman
{281.5446,-1261.4562,73.9319,305.0017}, // Another richman property
{790.1918,-839.8533,60.6328,191.9514}, // Mulholland house
{1299.1859,-801.4249,84.1406,269.5274}, // Maddoggs
{1240.3170,-2036.6886,59.9575,276.4659}, // Verdant Bluffs
{2215.5181,-2627.8174,13.5469,273.7786}, // Ocean docks 1
{2509.4346,-2637.6543,13.6453,358.3565}, // Ocean Docks spawn 2
{1435.8024,2662.3647,11.3926,1.1650}, //  Northern train station
{1457.4762,2773.4868,10.8203,272.2754}, //  Northern golf club
{1739.6390,2803.0569,14.2735,285.3929}, //  Northern housing estate 1
{1870.3096,2785.2471,14.2734,42.3102}, //  Northern housing estate 2
{1959.7142,2754.6863,10.8203,181.4731}, //  Northern house 1
{2314.2556,2759.4504,10.8203,93.2711}, //  Northern industrial estate 1
{2216.5674,2715.0334,10.8130,267.6540}, //  Northern industrial estate 2
{2101.4192,2678.7874,10.8130,92.0607}, //  Northern near railway line
{1951.1090,2660.3877,10.8203,180.8461}, //  Northern house 2
{1666.6949,2604.9861,10.8203,179.8495}, //  Northern house 3
{2808.3367,2421.5107,11.0625,136.2060}, //  Northern shopping centre
{2633.3203,2349.7061,10.6719,178.7175}, //  V-Rock
{2606.6348,2161.7490,10.8203,88.7508}, //  South V-Rock
{2616.5286,2100.6226,10.8158,177.7834}, //  North Ammunation 1
{2491.8816,2397.9370,10.8203,266.6003}, //  North carpark 1
{2531.7891,2530.3223,21.8750,91.6686}, //  North carpark 2
{2340.6677,2530.4324,10.8203,177.8630}, //  North Pizza Stack
{2097.6855,2491.3313,14.8390,181.8117}, //  Emerald Isle
{1893.1000,2423.2412,11.1782,269.4385}, //  Souvenir shop
{1698.9330,2241.8320,10.8203,357.8584}, //  Northern casino
{1479.4559,2249.0769,11.0234,306.3790}, //  Baseball stadium 1
{1298.1548,2083.4016,10.8127,256.7034}, //  Baseball stadium 2
{1117.8785,2304.1514,10.8203,81.5490}, //  North carparks
{1108.9878,1705.8639,10.8203,0.6785}, //  Dirtring racing 1
{1423.9780,1034.4188,10.8203,90.9590}, //  Sumo
{1537.4377,752.0641,11.0234,271.6893}, //  Church
{1917.9590,702.6984,11.1328,359.2682}, //  Southern housing estate
{2089.4785,658.0414,11.2707,357.3572}, //  Southern house 1
{2489.8286,928.3251,10.8280,67.2245}, //  Wedding chapel
{2697.4717,856.4916,9.8360,267.0983}, //  Southern construction site
{2845.6104,1288.1444,11.3906,3.6506}, //  Southern train station
{2437.9370,1293.1442,10.8203,86.3830}, //  Wedding chapel (near Pyramid)
{2299.5430,1451.4177,10.8203,269.1287}, //  Carpark (near Pyramid)
{2214.3008,2041.9165,10.8203,268.7626}, //  Central parking lot
{2005.9174,2152.0835,10.8203,270.1372}, //  Central motel
{2222.1042,1837.4220,10.8203,88.6461}, //  Clowns Pocket
{2025.6753,1916.4363,12.3382,272.5852}, //  The Visage
{2087.9902,1516.5336,10.8203,48.9300}, //  Royal Casino
{2172.1624,1398.7496,11.0625,91.3783}, //  Auto Bahn
{2139.1841,987.7975,10.8203,0.2315}, //  Come-a-lot
{1860.9672,1030.2910,10.8203,271.6988}, //  Behind 4 Dragons
{1673.2345,1316.1067,10.8203,177.7294}, //  Airport carpark
{1412.6187,2000.0596,14.7396,271.3568}, //  South baseball stadium houses
{-2723.463,-314.8138,7.1839,43.5562},  // golf course spawn
{-2694.5344,64.5550,4.3359,95.0190},  // in front of a house
{-2458.2000,134.5419,35.1719,303.9446},  // hotel
{-2796.6589,219.5733,7.1875,88.8288},  // house
{-2706.5261,397.7129,4.3672,179.8611},  // park
{-2866.7683,691.9363,23.4989,286.3060},  // house
{-2764.9543,785.6434,52.7813,357.6817},  // donut shop
{-2660.9402,883.2115,79.7738,357.4440},  // house
{-2861.0796,1047.7109,33.6068,188.2750}, //  parking lot
{-2629.2009,1383.1367,7.1833,179.7006},  // parking lot at the bridge
{-2079.6802,1430.0189,7.1016,177.6486},  // pier
{-1660.2294,1382.6698,9.8047,136.2952}, //  pier 69
{-1674.1964,430.3246,7.1797,226.1357},  // gas station]
{-1954.9982,141.8080,27.1747,277.7342},  // train station
{-1956.1447,287.1091,35.4688,90.4465},  // car shop
{-1888.1117,615.7245,35.1719,128.4498},  // random
{-1922.5566,886.8939,35.3359,272.1293},  // random
{-1983.3458,1117.0645,53.1243,271.2390},  // church
{-2417.6458,970.1491,45.2969,269.3676},  // gas station
{-2108.0171,902.8030,76.5792,5.7139},  // house
{-2097.5664,658.0771,52.3672,270.4487},  // random
{-2263.6650,393.7423,34.7708,136.4152},  // random
{-2287.5027,149.1875,35.3125,266.3989},  // baseball parking lot
{-2039.3571,-97.7205,35.1641,7.4744},  // driving school
{-1867.5022,-141.9203,11.8984,22.4499},  // factory
{-1537.8992,116.0441,17.3226,120.8537},  // docks ship
{-1708.4763,7.0187,3.5489,319.3260},  // docks hangar
{-1427.0858,-288.9430,14.1484,137.0812},  // airport
{-2173.0654,-392.7444,35.3359,237.0159},  // stadium
{-2320.5286,-180.3870,35.3135,179.6980},  // burger shot
{-2930.0049,487.2518,4.9141,3.8258}  // harbor
};

//Colors
#define COLOR_AQUA (0x00FFFFFF)
#define COLOR_GREEN (0x00FF00FF)
#define COLOR_RED (0xFF0000FF)
#define COLOR_BLUE (0x0000FFFF)
#define COLOR_BLACK (0x000000FF)
#define COLOR_YELLOW (0xFFFF00FF)
#define COLOR_WHITE (0xFFFFFFFF)
#define COLOR_PINK (0xFF00FFFF)

//Embedded Colors
#define COL_GREEN "{00FF00}"
#define COL_AQUA "{00FFFF}"
#define COL_RED "{FF0000}"
#define COL_YELLOW "{FFFF00}"
#define COL_WHITE "{FFFFFF}"
#define COL_ORANGE "{F9B857}"

//Dialogs
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_RULES 3
#define DIALOG_ACMDS 4
#define DIALOG_AMENU 5

//Defines
#define Admin_Car_ID 432 //vehicleid for Admin car
#define Admin_Heli_ID 425 //vehicleid for Admin helicopter
#define Admin_Plane_ID 511 //vehicleid for Admin plane
#define Admin_Boat_ID 430 //vehicleid for Admin boat
#define KillingAllowed false //false does not allow killing outside the DM zones, true allows killing outside the DM zone

//Enum
enum pInfo
{
    Password,
    Cash,
    DMKills,
    DMDeaths,
    Deaths,
    Admin,
    VipType,
    Xp
}

new PlayerInfo[MAX_PLAYERS][pInfo];

enum dInfo
{
    InDMZone
}

new DMInfo[MAX_PLAYERS][dInfo];


//Path
#define PATH "ExtremeFreeroam/Users/%s.ini"
#define MainConfigFile "ExtremeFreeroam/Config/mainconfig.ini"

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n==============================================");
    print(" eXtreme freeroam v1.0 by stormchaser206 loaded!");
    print("================================================\n");
}

#endif

public OnGameModeInit()
{
    // OnGameModeInIt
    SetGameModeText("eXtreme freeroam v1.0");
    AddPlayerClass(0,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(1,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(2,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(3,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(6,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(12,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(13,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(16,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(22,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(24,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(26,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(30,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(42,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(45,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(50,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(56,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(60,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(79,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(94,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(250,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
    AddPlayerClass(253,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(255,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(264,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(265,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(269,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(271,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(274,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(277,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(282,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(283,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(285,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(286,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(287,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(288,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
    AddPlayerClass(289,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
   
    //Ranks
    SetPromotionMode(1);
    AddRank(0, "Newbie", 0, 100, 100, 100.0, 0, 0);
    AddRank(1, "Beginner", 8, 450, 100, 100.0, 0, 0);
    AddRank(2, "Progressive", 15, 600, 100, 100.0, 0, 0);
    AddRank(3, "Worker", 21, 900, 100, 100.0, 0, 0);
    AddRank(4, "Advanced", 30, 1400, 100, 100.0, 0, 0);
    AddRank(5, "Independent", 45, 3000, 100, 120.0, 0, 0);
    AddRank(6, "Professional", 60, 5000, 110, 140.75, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    print("==================================================");
    print(" eXtreme freeroam v1.0 by stormchaser206 unloaded!");
    print("==================================================");
   
    IRC_Quit(gBotID[0], "Bot Exiting.");
    IRC_DestroyGroup(gGroupID);
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerCameraPos(playerid, -1492.8887, 734.4927, 7.1823);
    SetPlayerCameraLookAt(playerid, -1484.4331, 734.8915, 7.1782);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    SendClientMessageToAll(COLOR_PINK, "-| %s(%d) has joined eXtreme freeroam v1.0! |-");
    SendClientMessage(playerid, COLOR_PINK, "-| You have joined eXtreme freeroam v1.0! Welcome!");
    SendClientMessage(playerid, COLOR_GREEN, "Type /help or /commands if you need help. Also make sure to read /rules.");
   
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
   
    new IRC_String[150];
    format(IRC_String, sizeof(IRC_String),"*** %s(%d) has connected to eXtreme freeroam v1.0!", pName, playerid);
    IRC_GroupSay(gGroupID, IRC_CHANNEL, IRC_String);
    S_OnPlayerConnect(playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new pName[MAX_PLAYER_NAME],Msg[30],string[100];
    GetPlayerName(playerid, pName, sizeof(pName));
   
    if(reason == 0) Msg = "Timeout";
    if(reason == 1) Msg = "Leaving";
    if(reason == 2) Msg = "Kicked/Banned";
    format(string, sizeof(string),"*** %s(%d) has left the server (%s)", pName, playerid, Msg);
    IRC_GroupSay(gGroupID, IRC_CHANNEL, string);
    format(string, sizeof(string),"-| %s(%d) has left the server (%s) |-", pName, playerid, Msg);
    SendClientMessageToAll(COLOR_PINK, string);
    S_OnPlayerDisconnect(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new randSpawn = 0;
   
    GivePlayerWeapon(playerid, 5, 1);
    GivePlayerWeapon(playerid, 18, 20);
    GivePlayerWeapon(playerid, 22, 120);
    GivePlayerWeapon(playerid, 31, 300);
    SetPlayerInterior(playerid, 0);
   
    randSpawn = random(sizeof(gRandomSpawns));
    SetPlayerPos(playerid,
        gRandomSpawns[randSpawn][0],
        gRandomSpawns[randSpawn][1],
        gRandomSpawns[randSpawn][2]);
    SetPlayerFacingAngle(playerid,gRandomSpawns[randSpawn][3]);
    S_OnPlayerSpawn(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(killerid, name, sizeof(name));
    new string[100];
    PlayerInfo[playerid][Deaths]++;

    if(killerid != INVALID_PLAYER_ID)
    {
        if(DMInfo[killerid][InDMZone] == 1 && DMInfo[playerid][InDMZone] == 1)
        {
            PlayerInfo[killerid][DMKills]++;
            GameTextForPlayer(killerid, "~y~+10 XP!", 2000, 6);
            PlayerInfo[playerid][Xp] += 10;
        }
       
        #if KillingAllowed == false
        SetPlayerHealth(killerid, 0);
        GameTextForPlayer(killerid, "~r~KILLING NOT ALLOWED!", 5000, 6);
        format(string, sizeof(string),"-| %s(%d) has been killed for killing outside the DM zones! |-", name, killerid);
        SendClientMessageToAll(COLOR_RED, string);
        #endif
    }
    SendDeathMessage(killerid, playerid, reason);
    S_OnPlayerDeath(killerid);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(commands, 8, cmdtext);
    dcmd(help, 4, cmdtext);
    dcmd(rules, 5, cmdtext);
    dcmd(acmds, 5, cmdtext);
   
    if(PlayerInfo[playerid][Admin] >= 1)
    {
        dcmd(amenu, 5, cmdtext);
    }
    return 1;
}

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[])
{
    if(cmd == "noon")
    {
        SetWorldTime(12);
    }
    return 1;
}

public OnPlayerRequestSpawn(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)
{
    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[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Register",""COL_RED"You have entered an invalid password.\n"COL_WHITE"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,"Cash",0);
                INI_WriteInt(File,"DMKills",0);
                INI_WriteInt(File,"DMDeaths",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"XP",0);
                INI_Close(File);
                SpawnPlayer(playerid);
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Blank Gamemode "#COL_DGREEN"Y_INI "#COL_EASY"(V3)\n\n"#COL_RED"You have entered a invalid password\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
                }
                return 1;
            }
        }
    }
    return 1;
}

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

/*=====================================================================================//
=== DCMD COMMANDS =====================================================================//
=======================================================================================*/


dcmd_commands(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "-| Commands |-");
    SendClientMessage(playerid, COLOR_AQUA, "Other: /kill, /stats");
    SendClientMessage(playerid, COLOR_AQUA, "Information: /commands, /help, /rules");
    SendClientMessage(playerid, COLOR_AQUA, "Lists: /admins");
    return 1;
}

dcmd_help(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "-| Help |-");
    SendClientMessage(playerid, COLOR_AQUA, "Welcome to eXtreme freeroam v1.0.");
    SendClientMessage(playerid, COLOR_AQUA, "If you want to see the available commands, type /commands");
    SendClientMessage(playerid, COLOR_AQUA, "This gamemode is about roaming San Andreas, having fun, trying out all the features");
    SendClientMessage(playerid, COLOR_AQUA, "and enjoying it.");
    SendClientMessage(playerid, COLOR_AQUA, "Also, there is an XP system. You earn XP for killing in the DM zone, earning achievements, and more! We hope you have fun!");
    return 1;
}

dcmd_rules(playerid)
{
    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Rules", "1. No Hacking or Illegal mods\n2. No Advertising (Example: Advertising your server)\n3. No Asking for administrator rights\n4. Respect other players and admins\n5. Non-Admins should stay out of the admin area.\n** Failure to comply with these rules will result in a{FF0000} ban, kick, or jail, depending on the rule.\n", "OK", "");
    return 1;
}

dcmd_acmds(playerid)
{
    ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX, "Level 1 Commands", "{00FF00}++ Normal Player Commands\n#MessageHere - Admin Chat\n/fixcar - Fix your car\n/getinfo - Get a players Info\n/ip - Get a player's IP (Also available in /getinfo)\n/astats - See your admin stats\n/amenu - Shows a list of admin options\n/setmytime - Lets you set your time\n/setmyweather - Lets you set your weather\n", "OK", "");
    return 1;
}

dcmd_amenu(playerid)
{
    //More options will come in the next version.
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Admin Menu", "Admin Vehicles\nGod Mode\nVehicles\nWeapons\nRCON Commands\nMy Admin Stats\nServer Variables", "OK", "");
    return 1;
}
/*=======================================================//
=== STOCKS ==============================================//
=========================================================*/

stock GetServerHostName()
{
    new String[256];
    GetServerVarAsString("hostname", String, sizeof(String));
    return String;
}

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


//Hash Function (Credits to Dracoblue)
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;
}

//STRTOK
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

//========== Load User Data ==============//
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][Password]);
    INI_Int("Cash",PlayerInfo[playerid][Cash]);
    INI_Int("DMKills",PlayerInfo[playerid][DMKills]);
    INI_Int("DMDeaths",PlayerInfo[playerid][DMDeaths]);
    INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
    INI_Int("Admin",PlayerInfo[playerid][Admin]);
    INI_Int("XP",PlayerInfo[playerid][Xp]);
    return 1;
}

//=========================== IRC CALLBACKS AND COMMANDS ======================//
Errors:
Код:
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(414) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(414) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(415) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(415) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(416) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(416) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(417) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(417) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(421) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(421) : warning 202: number of arguments does not match definition
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(463) : error 033: array must be indexed (variable "cmd")
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(668) : error 021: symbol already defined: "udb_hash"
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(683) : error 021: symbol already defined: "strtok"
C:\Users\Keegan\Desktop\gamemodes\extremefr.pwn(716) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#2

For the love of god, show us the lines that you get the errors on, not the whole thing.
Reply
#3

OK, No one's said that to me before, so dont yell at me.

Lines:
463:
pawn Код:
public OnRconCommand(cmd[])
{
    if(cmd == "noon") //Line 463
    {
        SetWorldTime(12);
    }
    return 1;
}
668:
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string; //Line 668
}
683:
pawn Код:
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; //Line 683
}
Reply
#4

Delete the stock udb_hash(683) since it says you have two of them

And can you show me your "new noon" please. Look for a line that says "new noon"

And sorry if you thought I shouted, but nope I wasin't shouting
Reply
#5

Actually, I looked at LuxAdmin, and fixed the RCON problem. I also commented out the stocks, and it worked! Thanks.
Reply
#6

Your welcome.

Happy testing!
Reply
#7

Wait now, when I start the gamemode, it turns off the server.

Код:
//===========================================================//
//====================== eXtreme freeroam v1.0 ==============//
//===========================================================//

/*========= FEATURES ==========//
-Admin Commands
-Saving of stats using Y_INI
-Plenty of Pickups
-A lot of vehicles
-And more!
*/

/*//////////
Planned in v1.2:
-A VIP System
-Fixes on Bugs in this version (If possible)
*///////////

#include <a_samp>
#include <YSI\y_ini>
#include <irc>
#include <Ranks>


/////////// IRC Settings ///////
#define IRC_SERVER "irc.mibbi.net" //Change to yours. For example, irc.mibbit.com
#define IRC_PORT (6667) //Your IRC Port. It is usually what the default is (6667)
#define IRC_CHANNEL "#FR4Life" //Your channel. For example, #ExtremeFreeroam

#define BOT_1_NICKNAME "Announcer"
#define BOT_1_REALNAME "SA-MP Bot"
#define BOT_1_USERNAME "Announcer_Bot"

#define MAX_BOTS (1)

new gBotID[MAX_BOTS], gGroupID;

//Spawns
//eXtreme freeroam spawns
//Credits to Grand Larceny

new Float:gRandomSpawns[][4] = {
{1751.1097,-2106.4529,13.5469,183.1979}, // El-Corona - Outside random house
{2652.6418,-1989.9175,13.9988,182.7107}, // Random house in willowfield - near playa de seville and stadium
{2489.5225,-1957.9258,13.5881,2.3440}, // Hotel in willowfield - near cluckin bell
{2689.5203,-1695.9354,10.0517,39.5312}, // Outside stadium - lots of cars
{2770.5393,-1628.3069,12.1775,4.9637}, // South in east beach - north of stadium - carparks nearby
{2807.9282,-1176.8883,25.3805,173.6018}, // North in east beach - near apartments
{2552.5417,-958.0850,82.6345,280.2542}, // Random house north of Las Colinas
{2232.1309,-1159.5679,25.8906,103.2939}, // Jefferson motel
{2388.1003,-1279.8933,25.1291,94.3321}, // House south of pig pen
{2481.1885,-1536.7186,24.1467,273.4944}, // East LS - near clucking bell and car wash
{2495.0720,-1687.5278,13.5150,359.6696}, // Outside CJ's house - lots of cars nearby
{2306.8252,-1675.4340,13.9221,2.6271}, // House in ganton - lots of cars nearby
{2191.8403,-1455.8251,25.5391,267.9925}, // House in south jefferson - lots of cars nearby
{1830.1359,-1092.1849,23.8656,94.0113}, // Mulholland intersection carpark
{2015.3630,-1717.2535,13.5547,93.3655}, // Idlewood house
{1654.7091,-1656.8516,22.5156,177.9729}, // Right next to PD
{1219.0851,-1812.8058,16.5938,190.0045}, // Conference Center
{1508.6849,-1059.0846,25.0625,1.8058}, // Across the street of BANK - lots of cars in intersection carpark
{1421.0819,-885.3383,50.6531,3.6516}, // Outside house in vinewood
{1133.8237,-1272.1558,13.5469,192.4113}, // Near hospital
{1235.2196,-1608.6111,13.5469,181.2655}, // Backalley west of mainstreet
{590.4648,-1252.2269,18.2116,25.0473}, // Outside "BAnk of San Andreas"
{842.5260,-1007.7679,28.4185,213.9953}, // North of Graveyard
{911.9332,-1232.6490,16.9766,5.2999}, // LS Film Studio
{477.6021,-1496.6207,20.4345,266.9252}, // Rodeo Place
{255.4621,-1366.3256,53.1094,312.0852}, // Outside propery in richman
{281.5446,-1261.4562,73.9319,305.0017}, // Another richman property
{790.1918,-839.8533,60.6328,191.9514}, // Mulholland house
{1299.1859,-801.4249,84.1406,269.5274}, // Maddoggs
{1240.3170,-2036.6886,59.9575,276.4659}, // Verdant Bluffs
{2215.5181,-2627.8174,13.5469,273.7786}, // Ocean docks 1
{2509.4346,-2637.6543,13.6453,358.3565}, // Ocean Docks spawn 2
{1435.8024,2662.3647,11.3926,1.1650}, //  Northern train station
{1457.4762,2773.4868,10.8203,272.2754}, //  Northern golf club
{1739.6390,2803.0569,14.2735,285.3929}, //  Northern housing estate 1
{1870.3096,2785.2471,14.2734,42.3102}, //  Northern housing estate 2
{1959.7142,2754.6863,10.8203,181.4731}, //  Northern house 1
{2314.2556,2759.4504,10.8203,93.2711}, //  Northern industrial estate 1
{2216.5674,2715.0334,10.8130,267.6540}, //  Northern industrial estate 2
{2101.4192,2678.7874,10.8130,92.0607}, //  Northern near railway line
{1951.1090,2660.3877,10.8203,180.8461}, //  Northern house 2
{1666.6949,2604.9861,10.8203,179.8495}, //  Northern house 3
{2808.3367,2421.5107,11.0625,136.2060}, //  Northern shopping centre
{2633.3203,2349.7061,10.6719,178.7175}, //  V-Rock
{2606.6348,2161.7490,10.8203,88.7508}, //  South V-Rock
{2616.5286,2100.6226,10.8158,177.7834}, //  North Ammunation 1
{2491.8816,2397.9370,10.8203,266.6003}, //  North carpark 1
{2531.7891,2530.3223,21.8750,91.6686}, //  North carpark 2
{2340.6677,2530.4324,10.8203,177.8630}, //  North Pizza Stack
{2097.6855,2491.3313,14.8390,181.8117}, //  Emerald Isle
{1893.1000,2423.2412,11.1782,269.4385}, //  Souvenir shop
{1698.9330,2241.8320,10.8203,357.8584}, //  Northern casino
{1479.4559,2249.0769,11.0234,306.3790}, //  Baseball stadium 1
{1298.1548,2083.4016,10.8127,256.7034}, //  Baseball stadium 2
{1117.8785,2304.1514,10.8203,81.5490}, //  North carparks
{1108.9878,1705.8639,10.8203,0.6785}, //  Dirtring racing 1
{1423.9780,1034.4188,10.8203,90.9590}, //  Sumo
{1537.4377,752.0641,11.0234,271.6893}, //  Church
{1917.9590,702.6984,11.1328,359.2682}, //  Southern housing estate
{2089.4785,658.0414,11.2707,357.3572}, //  Southern house 1
{2489.8286,928.3251,10.8280,67.2245}, //  Wedding chapel
{2697.4717,856.4916,9.8360,267.0983}, //  Southern construction site
{2845.6104,1288.1444,11.3906,3.6506}, //  Southern train station
{2437.9370,1293.1442,10.8203,86.3830}, //  Wedding chapel (near Pyramid)
{2299.5430,1451.4177,10.8203,269.1287}, //  Carpark (near Pyramid)
{2214.3008,2041.9165,10.8203,268.7626}, //  Central parking lot
{2005.9174,2152.0835,10.8203,270.1372}, //  Central motel
{2222.1042,1837.4220,10.8203,88.6461}, //  Clowns Pocket
{2025.6753,1916.4363,12.3382,272.5852}, //  The Visage
{2087.9902,1516.5336,10.8203,48.9300}, //  Royal Casino
{2172.1624,1398.7496,11.0625,91.3783}, //  Auto Bahn
{2139.1841,987.7975,10.8203,0.2315}, //  Come-a-lot
{1860.9672,1030.2910,10.8203,271.6988}, //  Behind 4 Dragons
{1673.2345,1316.1067,10.8203,177.7294}, //  Airport carpark
{1412.6187,2000.0596,14.7396,271.3568}, //  South baseball stadium houses
{-2723.463,-314.8138,7.1839,43.5562},  // golf course spawn
{-2694.5344,64.5550,4.3359,95.0190},  // in front of a house
{-2458.2000,134.5419,35.1719,303.9446},  // hotel
{-2796.6589,219.5733,7.1875,88.8288},  // house
{-2706.5261,397.7129,4.3672,179.8611},  // park
{-2866.7683,691.9363,23.4989,286.3060},  // house
{-2764.9543,785.6434,52.7813,357.6817},  // donut shop
{-2660.9402,883.2115,79.7738,357.4440},  // house
{-2861.0796,1047.7109,33.6068,188.2750}, //  parking lot
{-2629.2009,1383.1367,7.1833,179.7006},  // parking lot at the bridge
{-2079.6802,1430.0189,7.1016,177.6486},  // pier
{-1660.2294,1382.6698,9.8047,136.2952}, //  pier 69
{-1674.1964,430.3246,7.1797,226.1357},  // gas station]
{-1954.9982,141.8080,27.1747,277.7342},  // train station
{-1956.1447,287.1091,35.4688,90.4465},  // car shop
{-1888.1117,615.7245,35.1719,128.4498},  // random
{-1922.5566,886.8939,35.3359,272.1293},  // random
{-1983.3458,1117.0645,53.1243,271.2390},  // church
{-2417.6458,970.1491,45.2969,269.3676},  // gas station
{-2108.0171,902.8030,76.5792,5.7139},  // house
{-2097.5664,658.0771,52.3672,270.4487},  // random
{-2263.6650,393.7423,34.7708,136.4152},  // random
{-2287.5027,149.1875,35.3125,266.3989},  // baseball parking lot
{-2039.3571,-97.7205,35.1641,7.4744},  // driving school
{-1867.5022,-141.9203,11.8984,22.4499},  // factory
{-1537.8992,116.0441,17.3226,120.8537},  // docks ship
{-1708.4763,7.0187,3.5489,319.3260},  // docks hangar
{-1427.0858,-288.9430,14.1484,137.0812},  // airport
{-2173.0654,-392.7444,35.3359,237.0159},  // stadium
{-2320.5286,-180.3870,35.3135,179.6980},  // burger shot
{-2930.0049,487.2518,4.9141,3.8258}  // harbor
};

//Colors
#define COLOR_AQUA (0x00FFFFFF)
#define COLOR_GREEN (0x00FF00FF)
#define COLOR_RED (0xFF0000FF)
#define COLOR_BLUE (0x0000FFFF)
#define COLOR_BLACK (0x000000FF)
#define COLOR_YELLOW (0xFFFF00FF)
#define COLOR_WHITE (0xFFFFFFFF)
#define COLOR_PINK (0xFF00FFFF)

//Embedded Colors
#define COL_GREEN "{00FF00}"
#define COL_AQUA "{00FFFF}"
#define COL_RED "{FF0000}"
#define COL_YELLOW "{FFFF00}"
#define COL_WHITE "{FFFFFF}"
#define COL_ORANGE "{F9B857}"

//Dialogs
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_RULES 3
#define DIALOG_ACMDS 4
#define DIALOG_AMENU 5

//Defines
#define Admin_Car_ID 432 //vehicleid for Admin car
#define Admin_Heli_ID 425 //vehicleid for Admin helicopter
#define Admin_Plane_ID 511 //vehicleid for Admin plane
#define Admin_Boat_ID 430 //vehicleid for Admin boat
#define KillingAllowed false //false does not allow killing outside the DM zones, true allows killing outside the DM zone

//Enum
enum pInfo
{
    Password,
    Cash,
    DMKills,
    DMDeaths,
    Deaths,
    Admin,
    VipType,
    Xp
}

new PlayerInfo[MAX_PLAYERS][pInfo];

enum dInfo
{
	InDMZone
}

new DMInfo[MAX_PLAYERS][dInfo];


//Path
#define PATH "ExtremeFreeroam/Users/%s.ini"
#define MainConfigFile "ExtremeFreeroam/Config/mainconfig.ini"

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n==============================================");
	print(" eXtreme freeroam v1.0 by stormchaser206 loaded!");
	print("================================================\n");
}

#endif

public OnGameModeInit()
{
	// OnGameModeInIt
	SetGameModeText("eXtreme freeroam v1.0");
	AddPlayerClass(0,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0);
	AddPlayerClass(1,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(2,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(3,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(6,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(12,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(13,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(16,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(22,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(24,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(26,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(30,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(42,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(45,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(50,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(56,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(60,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(79,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(94,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(250,-1484.4493,734.8734,7.1782,92.2313,0,0,0,0,0,0); 
	AddPlayerClass(253,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(255,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(264,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(265,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(269,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(271,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(274,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(277,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(282,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(283,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(285,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(286,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(287,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(288,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0); 
	AddPlayerClass(289,-1484.4331,734.8915,7.1782,90.9779,0,0,0,0,0,0);
	
	//Ranks
	SetPromotionMode(1);
	AddRank(0, "Newbie", 0, 100, 100, 100.0, 0, 0);
	AddRank(1, "Beginner", 8, 450, 100, 100.0, 0, 0);
	AddRank(2, "Progressive", 15, 600, 100, 100.0, 0, 0);
	AddRank(3, "Worker", 21, 900, 100, 100.0, 0, 0);
	AddRank(4, "Advanced", 30, 1400, 100, 100.0, 0, 0);
	AddRank(5, "Independent", 45, 3000, 100, 120.0, 0, 0);
	AddRank(6, "Professional", 60, 5000, 110, 140.75, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	print("==================================================");
	print(" eXtreme freeroam v1.0 by stormchaser206 unloaded!");
	print("==================================================");
	
	IRC_Quit(gBotID[0], "Bot Exiting.");
	IRC_DestroyGroup(gGroupID);
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerCameraPos(playerid, -1492.8887, 734.4927, 7.1823);
	SetPlayerCameraLookAt(playerid, -1484.4331, 734.8915, 7.1782);
	return 1;
}

public OnPlayerConnect(playerid)
{
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pName, sizeof(pName));
	SendClientMessageToAll(COLOR_PINK, "-| %s(%d) has joined eXtreme freeroam v1.0! |-");
	SendClientMessage(playerid, COLOR_PINK, "-| You have joined eXtreme freeroam v1.0! Welcome!");
	SendClientMessage(playerid, COLOR_GREEN, "Type /help or /commands if you need help. Also make sure to read /rules.");
	
	if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    
	new IRC_String[150];
	format(IRC_String, sizeof(IRC_String),"*** %s(%d) has connected to eXtreme freeroam v1.0!", pName, playerid);
	IRC_GroupSay(gGroupID, IRC_CHANNEL, IRC_String);
	S_OnPlayerConnect(playerid);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new pName[MAX_PLAYER_NAME],Msg[30],string[100];
	GetPlayerName(playerid, pName, sizeof(pName));
	
	if(reason == 0) Msg = "Timeout";
	if(reason == 1) Msg = "Leaving";
	if(reason == 2) Msg = "Kicked/Banned";
	format(string, sizeof(string),"*** %s(%d) has left the server (%s)", pName, playerid, Msg);
	IRC_GroupSay(gGroupID, IRC_CHANNEL, string);
	format(string, sizeof(string),"-| %s(%d) has left the server (%s) |-", pName, playerid, Msg);
	SendClientMessageToAll(COLOR_PINK, string);
	S_OnPlayerDisconnect(playerid);
	return 1;
}

public OnPlayerSpawn(playerid)
{
    new randSpawn = 0;
    
	GivePlayerWeapon(playerid, 5, 1);
	GivePlayerWeapon(playerid, 18, 20);
	GivePlayerWeapon(playerid, 22, 120);
	GivePlayerWeapon(playerid, 31, 300);
	SetPlayerInterior(playerid, 0);
	
	randSpawn = random(sizeof(gRandomSpawns));
 	SetPlayerPos(playerid,
 		gRandomSpawns[randSpawn][0],
	 	gRandomSpawns[randSpawn][1],
	 	gRandomSpawns[randSpawn][2]);
	SetPlayerFacingAngle(playerid,gRandomSpawns[randSpawn][3]);
	S_OnPlayerSpawn(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(killerid, name, sizeof(name));
	new string[100];
    PlayerInfo[playerid][Deaths]++;

	if(killerid != INVALID_PLAYER_ID)
	{
		if(DMInfo[killerid][InDMZone] == 1 && DMInfo[playerid][InDMZone] == 1)
		{
		    PlayerInfo[killerid][DMKills]++;
			GameTextForPlayer(killerid, "~y~+10 XP!", 2000, 6);
			PlayerInfo[playerid][Xp] += 10;
		}
		
		#if KillingAllowed == false
		SetPlayerHealth(killerid, 0);
		GameTextForPlayer(killerid, "~r~KILLING NOT ALLOWED!", 5000, 6);
		format(string, sizeof(string),"-| %s(%d) has been killed for killing outside the DM zones! |-", name, killerid);
		SendClientMessageToAll(COLOR_RED, string);
		#endif
	}
	SendDeathMessage(killerid, playerid, reason);
	S_OnPlayerDeath(killerid);
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(commands, 8, cmdtext);
	dcmd(help, 4, cmdtext);
	dcmd(rules, 5, cmdtext);
	dcmd(acmds, 5, cmdtext);
	
	if(PlayerInfo[playerid][Admin] >= 1)
	{
	    dcmd(amenu, 5, cmdtext);
	}
	return 1;
}

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[])
{
	if(strcmp(cmd, "noon", true)==0)
	{
	    SetWorldTime(12);
	}
	return 1;
}

public OnPlayerRequestSpawn(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)
{
	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[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Register",""COL_RED"You have entered an invalid password.\n"COL_WHITE"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,"Cash",0);
                INI_WriteInt(File,"DMKills",0);
                INI_WriteInt(File,"DMDeaths",0);
                INI_WriteInt(File,"Deaths",0);
            	INI_WriteInt(File,"Admin",0);
            	INI_WriteInt(File,"XP",0);
                INI_Close(File);
                SpawnPlayer(playerid);
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Blank Gamemode "#COL_DGREEN"Y_INI "#COL_EASY"(V3)\n\n"#COL_RED"You have entered a invalid password\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
                }
                return 1;
            }
        }
    }
    return 1;
}

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

/*=====================================================================================//
=== DCMD COMMANDS =====================================================================//
=======================================================================================*/

dcmd_commands(playerid, params[])
{
	#pragma unused params
	SendClientMessage(playerid, COLOR_YELLOW, "-| Commands |-");
	SendClientMessage(playerid, COLOR_AQUA, "Other: /kill, /stats");
	SendClientMessage(playerid, COLOR_AQUA, "Information: /commands, /help, /rules");
	SendClientMessage(playerid, COLOR_AQUA, "Lists: /admins");
	return 1;
}

dcmd_help(playerid, params[])
{
	#pragma unused params
	SendClientMessage(playerid, COLOR_YELLOW, "-| Help |-");
	SendClientMessage(playerid, COLOR_AQUA, "Welcome to eXtreme freeroam v1.0.");
	SendClientMessage(playerid, COLOR_AQUA, "If you want to see the available commands, type /commands");
	SendClientMessage(playerid, COLOR_AQUA, "This gamemode is about roaming San Andreas, having fun, trying out all the features");
	SendClientMessage(playerid, COLOR_AQUA, "and enjoying it.");
	SendClientMessage(playerid, COLOR_AQUA, "Also, there is an XP system. You earn XP for killing in the DM zone, earning achievements, and more! We hope you have fun!");
	return 1;
}

dcmd_rules(playerid, params[])
{
	#pragma unused params
    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Rules", "1. No Hacking or Illegal mods\n2. No Advertising (Example: Advertising your server)\n3. No Asking for administrator rights\n4. Respect other players and admins\n5. Non-Admins should stay out of the admin area.\n** Failure to comply with these rules will result in a{FF0000} ban, kick, or jail, depending on the rule.\n", "OK", "");
    return 1;
}

dcmd_acmds(playerid, params[])
{
    #pragma unused params
    ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX, "Level 1 Commands", "{00FF00}++ Normal Player Commands\n#MessageHere - Admin Chat\n/fixcar - Fix your car\n/getinfo - Get a players Info\n/ip - Get a player's IP (Also available in /getinfo)\n/astats - See your admin stats\n/amenu - Shows a list of admin options\n/setmytime - Lets you set your time\n/setmyweather - Lets you set your weather\n", "OK", "");
    return 1;
}

dcmd_amenu(playerid, params[])
{
    #pragma unused params
	//More options will come in the next version.
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Admin Menu", "Admin Vehicles\nGod Mode\nVehicles\nWeapons\nRCON Commands\nMy Admin Stats\nServer Variables", "OK", "");
    return 1;
}
/*=======================================================//
=== STOCKS ==============================================//
=========================================================*/
stock GetServerHostName()
{
	new String[256];
	GetServerVarAsString("hostname", String, sizeof(String));
	return String;
}

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


/*Hash Function (Credits to Dracoblue)
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;
}

STRTOK
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}*/

//========== Load User Data ==============//
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][Password]);
    INI_Int("Cash",PlayerInfo[playerid][Cash]);
    INI_Int("DMKills",PlayerInfo[playerid][DMKills]);
    INI_Int("DMDeaths",PlayerInfo[playerid][DMDeaths]);
    INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
    INI_Int("Admin",PlayerInfo[playerid][Admin]);
    INI_Int("XP",PlayerInfo[playerid][Xp]);
    return 1;
}

//=========================== IRC CALLBACKS AND COMMANDS ======================//
Reply
#8

Wait,If the bot is an NPC show us the npcmodes and the recordings. That may have a problem since the bots also connect
Reply
#9

Im not connecting any bots.
Reply
#10

Can you please show us the server log?

Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)