Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* freeRoam BETA coded by Jack Robinson. */
- #include <a_samp>
- #include <dini>
- #include <sscanf2>
- #include <zcmd>
- #define webURL "www.sa-mp.com"
- #define gameMode "freeRoam"
- #define messageOfTheDay "Thanks for trying the server out!\nAdd us to your favourites if you enjoyed our script."
- #define killsForKillstreak (3)
- #define playerFileLoc "Accounts/%s.ini"
- // If you wish to change the sa-mp map name, please check under OnGameModeInit.
- #define mapName "freeRoam Map"
- #define gmName "freeRoam GM"
- // Colours
- #define colourWhite 0xFFFFFFFF
- #define colourGrey 0x666666FF
- #define colourBlue 0x0000FFFF
- #define colourLightBlue 0x0099FFFF
- #define colourRed 0xCC0000FF
- #define colourLightRed 0xFF0000FF
- #define colourGreen 0x009900FF
- #define colourLightGreen 0x00FF00FF
- #define colourOrange 0xFF6600FF
- #define colourYellow 0xFFFF00FF
- // Enumerations
- enum playerStuff
- {
- playerPass[256],
- playerFailedLoginAttempts,
- playerBanned,
- playerKills,
- playerDeaths,
- playerScore,
- playerAdmin,
- playerPolice,
- playerCuffed,
- playerTazed,
- playerWeaponSlot[13],
- };
- new playerInfo[MAX_PLAYERS][playerStuff];
- new playerFile[256];
- new globalAntiHack;
- stock getName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- }
- else
- {
- Name = "(null)";
- }
- return Name;
- }
- stock initAndSpawn(playerid)
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, 5000);
- new randSpawn = random(6);
- switch(randSpawn)
- {
- case 0:
- {
- SetSpawnInfo(playerid, 0, random(299), 1295.8590,-1424.8643,14.9531, 0, 0, 0, 0, 0, 0, 0);
- }
- case 1:
- {
- SetSpawnInfo(playerid, 0, random(299), 1545.5078,-1675.5112,13.5605, 0, 0, 0, 0, 0, 0, 0);
- }
- case 2:
- {
- SetSpawnInfo(playerid, 0, random(299), 1742.7448,-1864.3312,13.5740, 0, 0, 0, 0, 0, 0, 0);
- }
- case 3:
- {
- SetSpawnInfo(playerid, 0, random(299), 2495.1143,-1688.6969,13.9679, 0, 0, 0, 0, 0, 0, 0);
- }
- case 4:
- {
- SetSpawnInfo(playerid, 0, random(299), 2421.4343,-1224.3558,25.2236, 0, 0, 0, 0, 0, 0, 0);
- }
- case 5:
- {
- SetSpawnInfo(playerid, 0, random(299), 1459.2562,-1010.4940,26.8438, 0, 0, 0, 0, 0, 0, 0);
- }
- case 6:
- {
- SetSpawnInfo(playerid, 0, random(299), 825.0764,-1102.8118,25.7891, 0, 0, 0, 0, 0, 0, 0);
- }
- }
- SpawnPlayer(playerid);
- }
- stock loadPlayer(playerid)
- {
- format(playerFile, 256, playerFileLoc, getName(playerid));
- if(!fexist(playerFile))
- {
- dini_Create(playerFile);
- printf(""playerFileLoc" has been created.", getName(playerid));
- dini_Set(playerFile, "playerPass", "None");
- dini_IntSet(playerFile, "playerBanned", 0);
- dini_IntSet(playerFile, "playerKills", 0);
- dini_IntSet(playerFile, "playerScore", 0);
- dini_IntSet(playerFile, "playerDeaths", 0);
- dini_IntSet(playerFile, "playerAdmin", 0);
- dini_IntSet(playerFile, "playerWeaponSlot", 0);
- dini_IntSet(playerFile, "playerWeaponSlot1", 0);
- dini_IntSet(playerFile, "playerWeaponSlot2", 0);
- dini_IntSet(playerFile, "playerWeaponSlot3", 0);
- dini_IntSet(playerFile, "playerWeaponSlot4", 0);
- dini_IntSet(playerFile, "playerWeaponSlot5", 0);
- dini_IntSet(playerFile, "playerWeaponSlot6", 0);
- dini_IntSet(playerFile, "playerWeaponSlot7", 0);
- dini_IntSet(playerFile, "playerWeaponSlot8", 0);
- dini_IntSet(playerFile, "playerWeaponSlot9", 0);
- dini_IntSet(playerFile, "playerWeaponSlot10", 0);
- dini_IntSet(playerFile, "playerWeaponSlot11", 0);
- dini_IntSet(playerFile, "playerWeaponSlot12", 0);
- dini_IntSet(playerFile, "playerPolice", 0);
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registeration", "Welcome to the server!\nPlease enter your desired password!", "Register", "");
- }
- else
- {
- format(playerInfo[playerid][playerPass], 256, dini_Get(playerFile, "playerPass"));
- playerInfo[playerid][playerBanned] = dini_Int(playerFile, "playerBanned");
- playerInfo[playerid][playerKills] = dini_Int(playerFile, "playerKills");
- playerInfo[playerid][playerScore] = dini_Int(playerFile, "playerScore");
- playerInfo[playerid][playerDeaths] = dini_Int(playerFile, "playerDeaths");
- playerInfo[playerid][playerAdmin] = dini_Int(playerFile, "playerAdmin");
- playerInfo[playerid][playerPolice] = dini_Int(playerFile, "playerPolice");
- playerInfo[playerid][playerWeaponSlot][0] = dini_Int(playerFile, "playerWeaponSlot");
- playerInfo[playerid][playerWeaponSlot][1] = dini_Int(playerFile, "playerWeaponSlot1");
- playerInfo[playerid][playerWeaponSlot][2] = dini_Int(playerFile, "playerWeaponSlot2");
- playerInfo[playerid][playerWeaponSlot][3] = dini_Int(playerFile, "playerWeaponSlot3");
- playerInfo[playerid][playerWeaponSlot][4] = dini_Int(playerFile, "playerWeaponSlot4");
- playerInfo[playerid][playerWeaponSlot][5] = dini_Int(playerFile, "playerWeaponSlot5");
- playerInfo[playerid][playerWeaponSlot][6] = dini_Int(playerFile, "playerWeaponSlot6");
- playerInfo[playerid][playerWeaponSlot][7] = dini_Int(playerFile, "playerWeaponSlot7");
- playerInfo[playerid][playerWeaponSlot][8] = dini_Int(playerFile, "playerWeaponSlot8");
- playerInfo[playerid][playerWeaponSlot][9] = dini_Int(playerFile, "playerWeaponSlot9");
- playerInfo[playerid][playerWeaponSlot][10] = dini_Int(playerFile, "playerWeaponSlot10");
- playerInfo[playerid][playerWeaponSlot][11] = dini_Int(playerFile, "playerWeaponSlot11");
- playerInfo[playerid][playerWeaponSlot][12] = dini_Int(playerFile, "playerWeaponSlot12");
- if(playerInfo[playerid][playerBanned] == 0)
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Welcome back to the server!\nPlease enter your password", "Login", "");
- }
- else
- {
- new String[256];
- format(String, sizeof(String), "You are banned from this server. Please contact an administrator at %s to appeal your ban.", getName(playerid));
- SendClientMessage(playerid, colourRed, String);
- Kick(playerid);
- }
- }
- }
- stock givePlayerValidWeapon(playerid, weaponid)
- {
- if(IsPlayerConnected(playerid))
- {
- switch(weaponid)
- {
- case 0, 1:
- {
- playerInfo[playerid][playerWeaponSlot][0] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 1);
- }
- case 2, 3, 4, 5, 6, 7, 8, 9:
- {
- playerInfo[playerid][playerWeaponSlot][1] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 1);
- }
- case 22, 23, 24:
- {
- playerInfo[playerid][playerWeaponSlot][2] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 100);
- }
- case 25, 26, 27:
- {
- playerInfo[playerid][playerWeaponSlot][3] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 52);
- }
- case 28, 29, 32:
- {
- playerInfo[playerid][playerWeaponSlot][4] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 30, 31:
- {
- playerInfo[playerid][playerWeaponSlot][5] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 33, 34:
- {
- playerInfo[playerid][playerWeaponSlot][6] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 35, 36, 37, 38:
- {
- playerInfo[playerid][playerWeaponSlot][7] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 39:
- {
- playerInfo[playerid][playerWeaponSlot][8] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 41, 42, 43:
- {
- playerInfo[playerid][playerWeaponSlot][9] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 11, 12, 13, 14, 15:
- {
- playerInfo[playerid][playerWeaponSlot][10] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 44, 45:
- {
- playerInfo[playerid][playerWeaponSlot][11] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- case 40:
- {
- playerInfo[playerid][playerWeaponSlot][12] = weaponid;
- GivePlayerWeapon(playerid, weaponid, 50);
- }
- }
- }
- }
- stock sendAutoBan(playerid, string[])
- {
- new Message[256];
- if(globalAntiHack == 1)
- {
- format(Message, 256, "Anti-Ban: %s has been auto banned for hacking. (%s)", getName(playerid), string);
- SendClientMessageToAll(colourRed, Message);
- format(playerFile, 256, playerFileLoc, getName(playerid));
- dini_IntSet(playerFile, "Banned", 1);
- playerInfo[playerid][playerBanned] = 1;
- print(Message);
- Kick(playerid);
- }
- else printf("Anti-Ban: %s has been caught hacking (%s) but has not been banned, due to the anti-hack being disabled.", getName(playerid), string);
- }
- stock enableAntiHack()
- {
- if(globalAntiHack == 0)
- globalAntiHack = 1;
- else return print("The antihack is already enabled.");
- return 1;
- }
- stock disableAntiHack()
- {
- if(globalAntiHack == 1)
- globalAntiHack = 0;
- else return print("The antihack is already disabled.");
- return 1;
- }
- // Global Variables
- main()
- {
- }
- forward OneSecond();
- public OneSecond()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(gettime() >= GetPVarInt(i, "Tazed") && GetPVarInt(i, "Tazed") > 1)
- {
- TogglePlayerControllable(i, true);
- SendClientMessage(i, colourYellow, "The taze effect on you has worn off.");
- DeletePVar(i, "Tazed");
- playerInfo[i][playerTazed] = 0;
- }
- new Weapon = GetPlayerWeapon(i);
- switch(Weapon)
- {
- case 0, 1:
- {
- if(playerInfo[i][playerWeaponSlot][0] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 2, 3, 4, 5, 6, 7, 8, 9:
- {
- if(playerInfo[i][playerWeaponSlot][1] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 22, 23, 24:
- {
- if(playerInfo[i][playerWeaponSlot][2] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 25, 26, 27:
- {
- if(playerInfo[i][playerWeaponSlot][3] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 28, 29, 32:
- {
- if(playerInfo[i][playerWeaponSlot][4] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 30, 31:
- {
- if(playerInfo[i][playerWeaponSlot][5] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 33, 34:
- {
- if(playerInfo[i][playerWeaponSlot][6] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 35, 36, 37, 38:
- {
- if(playerInfo[i][playerWeaponSlot][7] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 39:
- {
- if(playerInfo[i][playerWeaponSlot][8] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 41, 42, 43:
- {
- if(playerInfo[i][playerWeaponSlot][9] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 11, 12, 13, 14, 15:
- {
- if(playerInfo[i][playerWeaponSlot][10] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 44, 45:
- {
- if(playerInfo[i][playerWeaponSlot][11] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- case 40:
- {
- if(playerInfo[i][playerWeaponSlot][12] != Weapon)
- {
- sendAutoBan(i, "Weapon Hacking");
- }
- }
- }
- }
- return 1;
- }
- public OnGameModeInit()
- {
- SendRconCommand("mapname freeRoam");
- print(""gameMode" has been loaded bsuccessfully! [SYSTEM]");
- enableAntiHack();
- print("The antihack has been successfully loaded.");
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- SetGameModeText(gmName);
- SetTimer("OneSecond", 6000, true);
- return 1;
- }
- /* *************************** COMMANDS *************************************** */
- command(givemegun, playerid, params[])
- {
- new weaponid, string[256], weaponname[26];
- if(sscanf(params, "d", weaponid))
- {
- SendClientMessage(playerid, colourWhite, "SYTNAX: /givemegun [weapon name]");
- }
- else
- {
- if(weaponid > 0 && weaponid < 44 || weaponid == 46)
- {
- givePlayerValidWeapon(playerid, weaponid);
- GetWeaponName(weaponid, weaponname, 26);
- format(string, sizeof(string), "You have given yourself a %s.", weaponname);
- }
- else SendClientMessage(playerid, colourGrey, "Invalid weapon ID. (Cannot be NV Goggles, IR goggles or Fists.)");
- }
- return 1;
- }
- command(spawncar, playerid, params[])
- {
- new vehicleid, colour1, colour2;
- if(sscanf(params, "ddd", vehicleid))
- {
- SendClientMessage(playerid, colourWhite, "SYNTAX: /spawncar [model id] [color 1] [color 2]");
- }
- else
- {
- if(vehicleid > 399 && vehicleid < 612)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new veh = CreateVehicle(vehicleid, x-2, y, z, 0, colour1, colour2, 20);
- SendClientMessage(playerid, colourWhite, "Vehicle spawned.");
- PutPlayerInVehicle(playerid, veh, 0);
- }
- else SendClientMessage(playerid, colourGrey, "Invalid vehicle ID.");
- }
- return 1;
- }
- command(togantihack, playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[256];
- switch(globalAntiHack)
- {
- case 0:
- {
- globalAntiHack = 1;
- format(string, 256, "AdminCMD: The Anti-Hack has been enabled by Administrator %s.", getName(playerid));
- SendClientMessageToAll(colourRed, string);
- print(string);
- }
- case 1:
- {
- globalAntiHack = 0;
- format(string, 256, "AdminCMD: The Anti-Hack has been disabled by Administrator %s.", getName(playerid));
- SendClientMessageToAll(colourRed, string);
- print(string);
- }
- }
- }
- else SendClientMessage(playerid, colourGrey, "You do not have sufficient permissions to toggle the anti-cheat.");
- return 1;
- }
- command(cuff, playerid, params[])
- {
- if(playerInfo[playerid][playerPolice] == 1)
- {
- new Float:playerX, Float:playerY, Float:playerZ, string[256];
- GetPlayerPos(playerid, playerX, playerY, playerZ);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i, 5, playerX, playerY, playerZ))
- {
- if(playerInfo[i][playerTazed] == 1)
- {
- SetPlayerSpecialAction(i, SPECIAL_ACTION_CUFFED);
- playerInfo[i][playerCuffed] = 1;
- DeletePVar(i, "Tazed");
- playerInfo[i][playerTazed] = 0;
- TogglePlayerControllable(i, false);
- format(string, 256, "Police Officer %s has cuffed you, until uncuff.", getName(playerid));
- SendClientMessage(i, colourYellow, string);
- format(string, 256, "You have cuffed %s, until uncuff.", getName(playerid));
- SendClientMessage(i, colourYellow, string);
- }
- else SendClientMessage(playerid, colourGrey, "That user is not tazed, and you are unable to cuff them.");
- }
- }
- }
- else SendClientMessage(playerid, colourGrey, "You do not have sufficient permission to cuff a player.");
- return 1;
- }
- command(taze, playerid, params[])
- {
- if(playerInfo[playerid][playerPolice] == 1)
- {
- new tazedPlayers = 0;
- new Float:playerX, Float:playerY, Float:playerZ;
- GetPlayerPos(playerid, playerX, playerY, playerZ);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i, 5, playerX, playerY, playerZ))
- {
- tazedPlayers++;
- if(tazedPlayers > 1)
- {
- SendClientMessage(playerid, colourGrey, "There is more than one person in-range of the tazer.");
- }
- else if(playerInfo[i][playerTazed] == 0)
- {
- TogglePlayerControllable(i, false);
- SendClientMessage(i, colourYellow, "You have been tazed by a Police Officer. This will wear off in 10 seconds.");
- SetPVarInt(i, "Tazed", gettime()+10);
- playerInfo[i][playerTazed] = 1;
- }
- else SendClientMessage(playerid, colourGrey, "That user is already cuffed.");
- }
- }
- }
- else SendClientMessage(playerid, colourGrey, "You do not have sufficient permissions to taze a player.");
- return 1;
- }
- command(makecop, playerid, params[])
- {
- if(playerInfo[playerid][playerAdmin] >= 4)
- {
- new targetID, string[256];
- if(sscanf(params, "u", targetID))
- {
- SendClientMessage(playerid, colourWhite, "SYNTAX: /makecop [playerid]");
- }
- else
- {
- if(IsPlayerConnected(targetID))
- {
- if(playerInfo[targetID][playerPolice] == 0)
- {
- format(string, sizeof(string), "AdminCMD: %s has been made a Police Officer by Administrator %s.", getName(targetID), getName(playerid));
- SendClientMessageToAll(colourRed, string);
- format(playerFile, 256, playerFileLoc, getName(targetID));
- dini_IntSet(playerFile, "playerPolice", 1);
- playerInfo[targetID][playerPolice] = 1;
- }
- else SendClientMessage(playerid, colourGrey, "This user is already a Police Officer!");
- }
- else SendClientMessage(playerid, colourGrey, "This user is not connected.");
- }
- }
- else SendClientMessage(playerid, colourGrey, "You do not have sufficient permission to make somebody a Police Officer.");
- return 1;
- }
- command(kick, playerid, params[])
- {
- if(playerInfo[playerid][playerAdmin] >= 1)
- {
- new targetID, reason[155], string[256];
- if(sscanf(params, "us", targetID, reason))
- {
- SendClientMessage(playerid, colourWhite, "SYNTAX: /kick [playerid] [reason]");
- }
- else
- {
- if(IsPlayerConnected(targetID))
- {
- format(string, sizeof(string), "AdminCMD: %s has been kicked from the server by Administrator %s. Reason: %s", getName(targetID), getName(playerid), reason);
- SendClientMessageToAll(colourRed, string);
- Kick(targetID);
- }
- else SendClientMessage(playerid, colourGrey, "That user is not connected.");
- }
- }
- else SendClientMessage(playerid, colourGrey, "You do not have sufficient permission to kick a user from the server.");
- return 1;
- }
- command(heal, playerid, params[])
- {
- new Float:hp;
- GetPlayerHealth(playerid, hp);
- if(hp < 100)
- {
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, colourWhite, "You have healed yourself!");
- }
- else SendClientMessage(playerid, colourWhite, "You already have full health!");
- return 1;
- }
- command(makeadmin, playerid, params[])
- {
- if(playerInfo[playerid][playerAdmin] >= 4)
- {
- new targetID, level, string[256];
- if(sscanf(params, "ud", targetID, level))
- {
- SendClientMessage(playerid, colourWhite, "SYNTAX: /makeadmin [playerid] [level]");
- }
- else
- {
- if(IsPlayerConnected(targetID))
- {
- if(playerInfo[playerid][playerAdmin] > playerInfo[targetID][playerAdmin])
- {
- if(playerInfo[playerid][playerAdmin] == 0 && level == 1)
- {
- format(string, sizeof(string), "AdminCMD: %s has been hired to the administrator team by Administrator %s.", getName(targetID), getName(playerid));
- SendClientMessageToAll(colourRed, string);
- playerInfo[targetID][playerAdmin] = level;
- format(playerFile, 256, playerFileLoc, getName(targetID));
- dini_IntSet(playerFile, "playerAdmin", level);
- }
- else if(level == 0 && playerInfo[targetID][playerAdmin])
- {
- format(string, sizeof(string), "AdminCMD: %s has been removed from the administrator team by Administrator %s.", getName(targetID), getName(playerid));
- SendClientMessageToAll(colourRed, string);
- playerInfo[targetID][playerAdmin] = level;
- format(playerFile, 256, playerFileLoc, getName(targetID));
- dini_IntSet(playerFile, "playerAdmin", level);
- }
- else if(level == playerInfo[playerid][playerAdmin])
- {
- SendClientMessage(playerid, colourGrey, "That user is already that level! Please choose a value higher or lower than their current level.");
- }
- else if(level < playerInfo[playerid][playerAdmin] && level > 0)
- {
- format(string, sizeof(string), "AdminCMD: %s has been demoted to level %d by Administrator %s.", getName(targetID), level, getName(playerid));
- SendClientMessageToAll(colourRed, string);
- playerInfo[targetID][playerAdmin] = level;
- format(playerFile, 256, playerFileLoc, getName(targetID));
- dini_IntSet(playerFile, "playerAdmin", level);
- }
- else if(level > playerInfo[playerid][playerAdmin] && level > 0)
- {
- format(string, sizeof(string), "AdminCMD: %s has been promoted to level %d by Administrator %s.", getName(targetID), level, getName(playerid));
- SendClientMessageToAll(colourRed, string);
- playerInfo[targetID][playerAdmin] = level;
- format(playerFile, 256, playerFileLoc, getName(targetID));
- dini_IntSet(playerFile, "playerAdmin", level);
- }
- else if(level < 0)
- {
- SendClientMessage(playerid, colourGrey, "You can not change an administrator's level to less than 0!");
- }
- print(string);
- }
- else SendClientMessage(playerid, colourGrey, "You can not change a higher level administrator's level!");
- }
- else SendClientMessage(playerid, colourGrey, "You cannot change an offline user's administrator level.");
- }
- }
- else SendClientMessage(playerid, colourGrey, "You don't have sufficient permissions to change an administrator's rank.");
- return 1;
- }
- /* *************************** COMMANDS *************************************** */
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- loadPlayer(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- GivePlayerMoney(killerid, 1000);
- GivePlayerMoney(playerid, -1000);
- SendDeathMessage(playerid, killerid, reason);
- new randSpawn = random(6);
- switch(randSpawn)
- {
- case 0:
- {
- SetSpawnInfo(playerid, 0, random(299), 1295.8590,-1424.8643,14.9531, 0, 0, 0, 0, 0, 0, 0);
- }
- case 1:
- {
- SetSpawnInfo(playerid, 0, random(299), 1545.5078,-1675.5112,13.5605, 0, 0, 0, 0, 0, 0, 0);
- }
- case 2:
- {
- SetSpawnInfo(playerid, 0, random(299), 1742.7448,-1864.3312,13.5740, 0, 0, 0, 0, 0, 0, 0);
- }
- case 3:
- {
- SetSpawnInfo(playerid, 0, random(299), 2495.1143,-1688.6969,13.9679, 0, 0, 0, 0, 0, 0, 0);
- }
- case 4:
- {
- SetSpawnInfo(playerid, 0, random(299), 2421.4343,-1224.3558,25.2236, 0, 0, 0, 0, 0, 0, 0);
- }
- case 5:
- {
- SetSpawnInfo(playerid, 0, random(299), 1459.2562,-1010.4940,26.8438, 0, 0, 0, 0, 0, 0, 0);
- }
- case 6:
- {
- SetSpawnInfo(playerid, 0, random(299), 825.0764,-1102.8118,25.7891, 0, 0, 0, 0, 0, 0, 0);
- }
- }
- SpawnPlayer(playerid);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- 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 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[])
- {
- if(dialogid == 1)
- {
- if(strlen(inputtext) > 2 && strlen(inputtext) < 16)
- {
- format(playerFile, 256, playerFileLoc, getName(playerid));
- dini_Set(playerFile, "playerPass", inputtext);
- format(playerInfo[playerid][playerPass], 256, inputtext);
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Message of the day!", messageOfTheDay, "Spawn", "");
- }
- else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registeration", "Welcome to the server!\nYour password is an invalid length. (Must be over 2 and under 16)", "Register", "Cancel");
- }
- if(dialogid == 2)
- {
- if(!isnull(inputtext))
- {
- format(playerFile, 256, playerFileLoc, getName(playerid));
- if(strcmp(dini_Get(playerFile, "playerPass"), inputtext, true) == 0)
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Message of the day!", messageOfTheDay, "Spawn", "");
- }
- else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Welcome back to the server!\nPlease enter your password", "Login", "");
- }
- }
- if(dialogid == 3)
- {
- initAndSpawn(playerid);
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Add Comment
Please, Sign In to add comment