Looking for scripters/helpers? Post here!

Modern Century Roleplay is opening a new server, Modern Warfare 2. The script is REALLY unique and awesome too. The script consists of many features. I just need someone to host it (hosted tab).
Contact me via PM, other info will be send there...
Reply

Looking for Beta Testers and Administrators
We've finally fixed our "STUPID" bugs and I guess we're ready to start the server, but first we will have to get everything tested to start without any problems.

Our server had a 60+ playerbase before and I guess we will get our playerbase back "easily".

I'm looking for Administrators in Australia / USA timezone, also Beta Testers in any time zones.

Mic isn't required for Beta Testers, but required for Administrators.

Send me a forum pm.

NOTE: We're not using released or edited script, our script made from scratch - fully dynamic and everything can be done in-game!
Reply

i want scripter hard can fixed script with a new include ad with West Coast Roleplay v3.5 please i want this! and i will make owner in my server



Код:
wcrp\admin.pwn(3749) : warning 213: tag mismatch
wcrp\admin.pwn(3752) : warning 213: tag mismatch
wcrp\admin.pwn(3763) : warning 213: tag mismatch
wcrp\admin.pwn(3764) : warning 213: tag mismatch
wcrp\admin.pwn(3765) : warning 213: tag mismatch
wcrp\admin.pwn(3767) : warning 213: tag mismatch
wcrp\admin.pwn(5530) : warning 203: symbol is never used: "playerid"
wcrp\vehicles.pwn(3953) : warning 204: symbol is assigned a value that is never used: "driver"
wcrp\business.pwn(2019) : warning 217: loose indentation
wcrp\business.pwn(2020) : warning 217: loose indentation
wcrp\business.pwn(2021) : warning 217: loose indentation
wcrp\business.pwn(2022) : warning 217: loose indentation
wcrp\business.pwn(2023) : warning 217: loose indentation
wcrp\business.pwn(2114) : warning 217: loose indentation
wcrp\interiors.pwn(278) : warning 209: function "interiorTryEnterExit" should return a value
wcrp\factions\leo.pwn(493) : warning 204: symbol is assigned a value that is never used: "rank"
wcrp\factions\leo.pwn(492) : warning 204: symbol is assigned a value that is never used: "faction"
wcrp\forumsync.pwn(31) : warning 203: symbol is never used: "email"
wcrp\forumsync.pwn(31) : warning 203: symbol is never used: "pass"
wcrp\forumsync.pwn(31) : warning 203: symbol is never used: "username"
wcrp\forumsync.pwn(31) : warning 203: symbol is never used: "playerid"
wcrp\forumsync.pwn(38) : warning 203: symbol is never used: "pass"
wcrp\forumsync.pwn(38) : warning 203: symbol is never used: "playerid"
wcrp\forumsync.pwn(92) : warning 203: symbol is never used: "newusername"
wcrp\forumsync.pwn(92) : warning 203: symbol is never used: "oldusername"
wcrp\forumsync.pwn(92) : warning 203: symbol is never used: "playerid"
wcrp\cartoys.pwn(96) : warning 217: loose indentation
wcrp\cartoys.pwn(100) : warning 203: symbol is never used: "inputtext"
wcrp\cartoys.pwn(409) : warning 203: symbol is never used: "CRY"
wcrp\cartoys.pwn(409) : warning 203: symbol is never used: "CRX"
wcrp\cheats.pwn(18) : warning 203: symbol is never used: "reason"
wcrp\cheats.pwn(61) : warning 203: symbol is never used: "inputtext"
wcrp\cheats.pwn(76) : warning 203: symbol is never used: "oldkeys"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1272) : warning 219: local variable "query" shadows a variable at a preceding level
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "EventOnPlayerDeath"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "IsEventAdmin"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "IsFlyCar"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "LookupPlayerIP"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "NumPlayerRentCars"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "RPTestLabels"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "SendMsgToRadioSnoopers"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "ShowAllNameTagsForPlayer"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(1398) : warning 203: symbol is never used: "SyncWarns"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212) : warning 204: symbol is assigned a value that is never used: "VoteStarter"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "canUseDrugCommand"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "diseaseCheck"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "doBankSettlement"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "doDiseaseEffect"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "endRace"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "fpscamkeysOnPlayerKeyState"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "getBasketTeam"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "getCraftCooldownTime"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "getDrugCooldownTime"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "getPlayerNumAjails"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "getVehicleReclaimPrice"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "hasOOCTag"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "infectNearbyPlayers"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "isBankInNegative"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "isRaceActive"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "isSwitchingChars"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "playerGetsDisease"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(212 -- 1398) : warning 203: symbol is never used: "sendTourettesMessage"
C:\Documents and Settings\Micheal\Desktop\[SCRIPT] INSTRUCTIONS INSIDE WCRP.PWN\WCRP.pwn(720) : warning 204: symbol is assigned a value that is never used: "servermaintenance"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


63 Warnings.
Reply

This is script WC-RP you needed this copy!
Код HTML:
#pragma dynamic 1000000

#include <a_samp>
#include <core>

//all non-samp includes below
#undef MAX_PLAYERS
#define MAX_PLAYERS 250 //update this with the server slots
#include <dns>
#include <streamer>
#include <a_mysql>
#include <foreach>
#include <sscanf2>
#include <progress> //for fuel bars taken from old script
//#include <timerfix>

#define RELEASENUMBER "3.4"

#define chc-debug false

//cmd/Dialog spam stuff
new lastCmdInfo[MAX_PLAYERS][2]; //number of cmds, time of last cmd
new lastDialogInfo[MAX_PLAYERS][2]; //same as last cmd

#define MAX_CMDS_PER_SEC 15
#define MAX_CMDS_TIME 1
#define CMD_RESET_TIME 3

#if chc-debug
	#define debug 1
	#define dbg-callbacks 0
	#define MYSQL_HOST "localhost"
	#define MYSQL_USER "root"
	#define MYSQL_DATABASE "wcrp_gameserver"
	#define MYSQL_PASSWORD ""
	#define ip_remote_check 0
#else
	#define debug 0
	#define dbg-callbacks 0
	#define MYSQL_HOST "localhost"
	#define MYSQL_USER "user"
	#define MYSQL_DATABASE "gameserver"
	#define MYSQL_PASSWORD ""
	#define ip_remote_check 0
#endif

#if debug
	#define VERSION ""RELEASENUMBER"-dev"
#else
	#define VERSION RELEASENUMBER
#endif

#define MODE_NAME "WC-RP "VERSION


#include <YSI\y_commands>
#include <YSI\y_master>
#include <YSI\y_colours>
#include <YSI\y_timers>


/*
	EDialogBase specifies the start offset of all dialog IDs
*/
enum {
	EAccountDialog_Base = 100,
	EBusiness_Base = EAccountDialog_Base + 100,
	EJob_Base = EBusiness_Base + 100,
	EAdminDialog_Base = EJob_Base + 100,
	EFamilyDialog_Base = EAdminDialog_Base + 100,
	EPointDialog_Base = EFamilyDialog_Base + 100,
	EVIPShopDialog_Base = EPointDialog_Base + 100,
	EAccessoriesDialog_Base = EVIPShopDialog_Base + 100,
	ERPDialog_Base = EAccessoriesDialog_Base + 100,
	ETurfDialog_Base = ERPDialog_Base + 100,
	EVehicles_Base = ETurfDialog_Base + 100,
	EFactionsDialog_Base = EVehicles_Base + 100,
	EGovDialog_Base = EFactionsDialog_Base + 100,
	EPaintball_Base = EGovDialog_Base + 100,
	ELockers_Base = EPaintball_Base + 100,
	EHelp_Base = ELockers_Base + 100,
	EGPS_Base = EHelp_Base + 100,
	EKeyBind_Base = EGPS_Base + 100,
	EIllegalBusiness_Base = EKeyBind_Base + 100,
	ERacing_Base = EIllegalBusiness_Base + 100,
	EHouseFurniture_Base = ERacing_Base + 100,
	EGunFactory_Base = EHouseFurniture_Base + 100,
	EWallTag_Base = EGunFactory_Base + 100,
	ECarToys_Base = EWallTag_Base + 100,
	ECheats_Base = ECarToys_Base + 100,
	EDialogBase_End = ECheats_Base + 100,
};

//global variables used within all scripts
new g_mysql_handle; 
new levelcost = 10000;
new levelexp = 4;
new tempstr[128];
new query[1024];
new dialogstr[4500];


#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA
#define COLOR_NEWS 0xFFA500AA
#define COLOR_OOC 0xE0FFFFAA
#define COLOR_LIGHTGREEN 0x7CFC00AA
#define COLOR_MEDIUMAQUA 0x83BFBFFF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_LIGHTBLUE 0x00BFFFAA
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_GREEN 0x33AA33AA
#define COLOR_NEWS 0xFFA500AA
#define COLOR_OOC 0xE0FFFFAA
#define COLOR_BRIGHTRED 0xFF0000FF
#define COLOR_RED 0xAA3333AA
#define COLOR_ADMINCMD 0xAFAFAFAA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xFFCC00AA
#define COLOR_LIGHTYELLOW2 0xF5DEB3AA
#define OBJECTIVE_COLOR 0x64000064
#define TEAM_GREEN_COLOR 0xFFFFFFAA
#define TEAM_JOB_COLOR 0xFFB6C1AA
#define TEAM_HIT_COLOR 0xFFFFFF00
#define TEAM_BLUE_COLOR 0x8D8DFF00
#define COLOR_ADD 0x63FF60AA
#define TEAM_GROVE_COLOR 0x00D900C8
#define TEAM_VAGOS_COLOR 0xFFC801C8
#define TEAM_BALLAS_COLOR 0xD900D3C8
#define TEAM_AZTECAS_COLOR 0x01FCFFC8
#define TEAM_CYAN_COLOR 0xFF8282AA
#define COLOUR_DONATEPURPLE 0xFF33FFAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_HELPERCHAT 0x40808096

#define DP_VALUE 0.10 //value of 1 DP in real dollars
#define MAX_HEALTH 98.0
#define MAX_ARMOUR 98.0
#define ENTEREXIT_COOLDOWN 2
#define NAMETAG_DRAW_DISTANCE 15.0
#define INFINITE_AMMO 22767
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define KEY_AIM     (128) //Defaults to SPACEBAR but it works as the aim key as well.
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define HOLDING(%0) \
	((newkeys & (%0)) == (%0))	//Holding key definition
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-





enum ELicenseFlags (<<= 1) {
	ELicense_Drivers = 1,
	ELicense_Flying,
	ELicense_Fishing,
	ELicense_Sailing,
	ELicense_Gun,
};

enum EAccountFlags (<<= 1) {
	EAccountFlags_NoNewb = 1,
	EAccountFlags_NoAds,
	EAccountFlags_NoOOC,
	EAccountFlags_HideAdminMessages,
	EAccountFlags_NoHints,
	EAccountFlags_NoJobMessages,
	EAccountFlags_AdBanned,
	EAccountFlags_NoChatAnim,
	EAccountFlags_FurnitureBanned,
	EAccountFlags_MustRedoTest,
	EAccountFlags_MovieMode,
	EAccountFlags_ShowRedScreen,
	EAccountFlags_BlockPMS,
	EAccountFlags_NoHelperChat,
	EAccountFlags_NoHungerTD,
	EAccountFlags_NewbBanned,
	EAccountFlags_GunBanned,
};

enum FactionType {
	EFactionType_None,
	EFactionType_LEO,
	EFactionType_Government,
	EFactionType_Hitman,
	EFactionType_SanNews,
	EFactionType_EMS,
};

enum ESettingsInfo {
	SettingsName[64],
	EAccountFlags:SettingsFlag,
}
new SettingsInfo[][ESettingsInfo] = {{"No Newb Chat",EAccountFlags_NoNewb},
									{"No Ads/News",EAccountFlags_NoAds},
									{"No Hints",EAccountFlags_NoHints},
									{"Hide Admin Messages",EAccountFlags_HideAdminMessages},
									{"No Job Messages",EAccountFlags_NoJobMessages},
									{"No Chat Animations",EAccountFlags_NoChatAnim},
									{"No Map Locations",EAccountFlags_MovieMode},
									{"No PM's",EAccountFlags_BlockPMS},
									{"No Helper Chat",EAccountFlags_NoHelperChat},
									{"No Hunger Text Draw",EAccountFlags_NoHungerTD}
									};
									
									
//functions with tag definitions(to prevent compiler reparse(increasing compile time))
Float:getLockDistance(ELockType:lock); //vehicles.pwn
FactionType:getFactionType(faction); //factions.pwn
FactionType:getPlayerFactionType(playerid);
ESafeItemType:findItemType(index); //lockers.pwn
Float:getPlantLength(i); //plants.pwn
HouseHasSafe(id); //safes.pwn
DeleteHouseSafe(id); //safes.pwn
ESafeOwnerType:getSafeOwnerType(safeid); //safes.pwn
SendRadioMsgToListeners(sender, msg[]);//specialitems.pwn
SendDepartmentMsgToListeners(sender, msg[]);//specialitems.pwn
SendWTMsgToListeners(sender, msg[], channel); //specialitems.pwn

#include "wcrp\utils.pwn"
#include "wcrp\textdraws.pwn"
#include "wcrp\colourcodes.pwn"
#include "wcrp\admin.pwn"
#include "wcrp\account.pwn" //account/character related functions get forwarded here
//#include "wcrp\weather.pwn"
#include "wcrp\rp.pwn" //generic RP related stuff here(such as /me, /do)
#include "wcrp\anticheat.pwn"
#include "wcrp\vehicles.pwn"
#include "wcrp\fishing.pwn"
#include "wcrp\business.pwn"
//jobs was here
#include "wcrp\interiors.pwn"
#include "wcrp\families.pwn"
#include "wcrp\houses.pwn"
#include "wcrp\jobs.pwn"
#include "wcrp\safes.pwn"
#include "wcrp\points.pwn"
#include "wcrp\turfs.pwn"
#include "wcrp\VIP.pwn"
#include "wcrp\accessories.pwn"
#include "wcrp\hospital.pwn"
#include "wcrp\factions.pwn"
#include "wcrp\mapping.pwn" //generic NON-DONATOR mapping
#include "wcrp\anims.pwn"
#include "wcrp\gov.pwn"
#include "wcrp\training.pwn"
#include "wcrp\paintball.pwn"
#include "wcrp\boxing.pwn"
#include "wcrp\cameras.pwn"
#include "wcrp\lockers.pwn"
#include "wcrp\IRC.pwn"
#include "wcrp\seatbelt.pwn"
#include "wcrp\anticbug.pwn"
#include "wcrp\help.pwn"
#include "wcrp\logging.pwn"
#include "wcrp\npc.pwn"
#include "wcrp\GPS.pwn"
#include "wcrp\radio.pwn"
#include "wcrp\keybinder.pwn"
//#include "wcrp\donatormapping.pwn"
#include "wcrp\plants.pwn"
#include "wcrp\forumsync.pwn"
#include "wcrp\itemdropping.pwn"
#include "wcrp\illegalbusiness.pwn"
#include "wcrp\bomb.pwn"
#include "wcrp\disease.pwn"
//weather was here
#include "wcrp\racing.pwn"
#include "wcrp\externalfuncs.pwn" //functions for use with CallRemoteFunction in other scripts
#include "wcrp\lotto.pwn"
#include "wcrp\housefurniture.pwn"
//#include "wcrp\evidencesystem.pwn" //Must be before the damage system
//#include "wcrp\damagesystem.pwn"
#include "wcrp\payphones.pwn" //Payphones
#include "wcrp\apartments.pwn" //Apartments
//#include "wcrp\gunfactory.pwn" //Gun factory, including dialogs
//#include "wcrp\servermottos.pwn" //Server auto namechanger
#include "wcrp\walltags.pwn" //Wall tags (families only)
#include "wcrp\specialitems.pwn"
#include "wcrp\hunger.pwn"
#include "wcrp\votekick.pwn"
#include "wcrp\speedtraps.pwn"
#include "wcrp\fpscamplusdb.pwn"
#include "wcrp\sqlqueries.pwn"
#include "wcrp\cartoys.pwn"
#include "wcrp\basketball.pwn"
#include "wcrp\cheats.pwn"
#include "wcrp\events.pwn"
/*
Script Documentation:

All Player PVars are below:

Account Related:
AdminLevel(int) - Players Admin
AccountName(string) - Account Name
AccountID(int) - mysql Account ID
*/

new UsedMapIDs[99]; 


main()
{
}

YCMD:commands(playerid, params[], help)
{
    if (help)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Lists all the commands a player can use.");
    }
    else
    {
        new
            count = Command_GetPlayerCommandCount(playerid);
        for (new i = 0; i != count; ++i)
        {
            SendClientMessage(playerid, 0xFF0000AA, Command_GetNext(i, playerid));
        }
    }
    return 1;
}
public OnGameModeInit()
{
	SetGameModeText(MODE_NAME);
	SendRconCommand("mapname Los Santos");
	#if debug
		mysql_debug(1);
	#else 
		mysql_debug(0);
	#endif
	enable_mutex(false);
	g_mysql_handle = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DATABASE,MYSQL_PASSWORD);
	Command_SetDeniedReturn( false );
	DisableInteriorEnterExits();
	EnableStuntBonusForAll(0);
	ShowPlayerMarkers(0);
	ShowNameTags(1);
	SetNameTagDrawDistance(NAMETAG_DRAW_DISTANCE);
	ManualVehicleEngineAndLights();
	acOnGameModeInit();
	jobsOnGameModeInit();
	mappingOnGameModeInit();
	adminOnGameModeInit();
	businessOnGameModeInit();
	VehOnGameModeInit();
	RPOnGameModeInit();
	interiorsOnGameModeInit();
	familiesOnGameModeInit(); //calls pointsOnGameModeInit() after families are loaded
	VIPOnGameModeInit();
	accessoriesOnGameModeInit();
	turfsOnGameModeInit();
	housesOnGameModeInit();
	factionsOnGameModeInit();
	animsOnGameModeInit();
	govOnGameModeInit();
	camsOnGameModeInit();
	lockersOnGameModeInit();
	seatbeltOnGameModeInit();
	AntiCBugOnGameModeInit();
	accountOnGameModeInit();
	helpOnGameModeInit();
	loggingOnGameModeInit();
	npcOnGameModeInit();
	//donatorMappingOnGameModeInit();
	plantsOnGameModeInit();
	illegalBizOnGameModeInit();
	//weatherOnGameModeInit();
	payphonesOnGameModeInit();
	apartmentsOnGameModeInit();
	//gunFactoryOnGameModeInit();
	wallTagsOnGameModeInit();
	TextDrawsOnGameModeInit();
	fishOnGameModeInit();
	hungerOnGameModeInit();
	//damageOnGameModeInit();
	SpeedTrapsOnGameModeInit();
	//onServerMottoGameModeInit();
	SQLQueriesOnGameModeInit();
	basketballOnGameModeInit();
	EventOnGameModeInit();
	return 1;
}

public OnGameModeExit()
{
	seatbeltOnGameModeExit();
	loggingOnGameModeExit();
	lottoOnGameModeExit();
	for(new i=0;i<MAX_PLAYERS;i++) {
		if(IsPlayerConnectEx(i)) {
			SendClientMessage(i, COLOR_RED, "SYSTEM: The server is shutting down, you are being kicked to save your information.");
			KickEx(i, "GMX");
		}
	}
	if(g_mysql_handle)
		mysql_close(g_mysql_handle);
	while(mysql_ping(g_mysql_handle) == 1) {
		#emit NOP
	}
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	accountOnPlayerRequestClass(playerid, classid);
	return 1;
}
public OnPlayerConnect(playerid)
{
	lastCmdInfo[playerid][0] = 0;
	lastCmdInfo[playerid][1] = 0;
	lastDialogInfo[playerid][0] = 0;
	lastDialogInfo[playerid][1] = 0;
	
	if(IsPlayerNPC(playerid)) {
		SpawnPlayer(playerid);
		return 0;
	}
	#if ip_remote_check
	LookupPlayerIP(playerid);
	#else
	OnPlayerConnectEx(playerid);
	#endif
	return 1;
}
forward OnPlayerConnectEx(playerid);
public OnPlayerConnectEx(playerid) {
	
	if(numUsersOnIP(playerid) > 6) {
		#if ip_remote_check
			KickEx(playerid, "Too many simultaneous sessions");
		#else
			Ban(playerid);
		#endif
		return 0;
	}
	mappingOnPlayerConnect(playerid);
	adminOnPlayerConnect(playerid); //used for checking bans, etc
	accountOnPlayerConnect(playerid); 
	interiorsOnPlayerConnect(playerid);
	pointsOnPlayerConnect(playerid);
	animsOnPlayerConnect(playerid);
	seatbeltOnPlayerConnect(playerid);
	AntiCBugOnPlayerConnect(playerid);
	camOnPlayerConnect(playerid);
	hungerOnPlayerConnect(playerid);
	//weatherOnPlayerConnect(playerid);
	return 0;
}



public OnPlayerDisconnect(playerid, reason)
{
	if(IsPlayerNPC(playerid)) {
		return 0;
	}
	paintballOnPlayerDisconnect(playerid, reason);
	vehOnPlayerDisconnect(playerid, reason);
	RPOnPlayerDisconnect(playerid, reason);
	accountOnPlayerDisconnect(playerid, reason);
	jobsOnPlayerDisconnect(playerid, reason);
	trainingOnPlayerDisconnect(playerid, reason);
	boxingOnPlayerDisconnect(playerid, reason);
	govOnPlayerDisconnect(playerid, reason);
	loggingOnPlayerDisconnect(playerid, reason);
	acOnPlayerDisconnect(playerid, reason);
	adminOnPlayerDisconnect(playerid, reason);
	medicOnPlayerDisconnect(playerid, reason);
	racingOnPlayerDisconnect(playerid, reason);
	//deleteRadioURLPVars(playerid);
	payphonesOnPayPhoneDisconnect(playerid, reason);
	//damageSystemOnPlayerDisconnect(playerid, reason);
	//weatherOnPlayerDisconnect(playerid, reason);
	//evidenceOnPlayerDisconnect(playerid);
	TextDrawOnPlayerDisconnect(playerid, reason);
	specialItemsOnPlayerDisconnect(playerid, reason);
	hungerOnPlayerDisconnect(playerid, reason);
	fishingOnPlayerDisconnect(playerid, reason);
	voteKickOnPlayerDisconnect(playerid, reason);
	SpeedTrapsOnPlayerDisconnect(playerid, reason);
	fpsCamOnPlayerDisconnect(playerid, reason);
	SQLQueriesOnPlayerDisconnect(playerid, reason);
	basketballOnPlayerDisconnect(playerid, reason);
	cheatsOnPlayerDisconnect(playerid, reason);
	eventOnPlayerDisconnect(playerid, reason);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerSpawn(%d)",playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	if(!IsPlayerNPC(playerid)) {
		if(!IsPlayerConnectEx(playerid)) {
			Kick(playerid);
		}
	}
	PreloadAnimLib(playerid,"MISC");
	PreloadAnimLib(playerid,"ped");
	PreloadAnimLib(playerid,"BEACH");
	PreloadAnimLib(playerid,"SMOKING");
	PreloadAnimLib(playerid,"BOMBER");
	PreloadAnimLib(playerid,"RAPPING");
	PreloadAnimLib(playerid,"SHOP");
	PreloadAnimLib(playerid,"COP_AMBIENT");
	PreloadAnimLib(playerid,"FOOD");
	PreloadAnimLib(playerid,"ON_LOOKERS");
	PreloadAnimLib(playerid,"SWEET");
	PreloadAnimLib(playerid,"DEALER");
	PreloadAnimLib(playerid,"KNIFE");
	PreloadAnimLib(playerid,"CRACK");
	PreloadAnimLib(playerid,"BLOWJOBZ");
	PreloadAnimLib(playerid,"PARK");
	PreloadAnimLib(playerid,"GYMNASIUM");
	PreloadAnimLib(playerid,"PAULNMAC");
	PreloadAnimLib(playerid,"CAR");
	PreloadAnimLib(playerid,"GANGS");
	PreloadAnimLib(playerid,"GHANDS");
	PreloadAnimLib(playerid,"MEDIC");
	PreloadAnimLib(playerid,"Attractors");
	PreloadAnimLib(playerid,"HEIST9");
	PreloadAnimLib(playerid,"RIOT");
	PreloadAnimLib(playerid,"CARRY");
	PreloadAnimLib(playerid,"KISSING");
	PreloadAnimLib(playerid,"INT_SHOP");
	PreloadAnimLib(playerid,"WUZI");
	PreloadAnimLib(playerid,"SWORD");
	
	if(IsPlayerInEvent(playerid)) {
		OnPlayerExitEvent(playerid);
		return 1;
	}
	
	acOnPlayerSpawn(playerid);
	accountOnPlayerSpawn(playerid); //for HP setting, etc
	hospitalOnPlayerSpawn(playerid);
	turfsOnPlayerSpawn(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerDeath(%d,%d,%d)",playerid,killerid, reason);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	adminOnPlayerDeath(playerid, killerid, reason);
	if(IsPlayerInEvent(playerid)) {
		return 1;
	}
	hospitalOnPlayerDeath(playerid, killerid, reason);
	turfsOnPlayerDeath(playerid, killerid, reason);
	trainingOnPlayerDeath(playerid);
	seatbeltOnPlayerDeath(playerid, killerid, reason);
	loggingOnPlayerDeath(playerid, killerid, reason);
	boxingOnPlayerDeath(playerid, killerid, reason);
	hitmanOnPlayerDeath(playerid, killerid, reason);
	racingOnPlayerDeath(playerid, killerid, reason);
	rpOnPlayerDeath(playerid, killerid, reason);
	//damageSystemOnPlayerDeath(playerid, killerid, reason);
	
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnVehicleSpawn(%d)",vehicleid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	vehOnVehicleSpawn(vehicleid);
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnVehicleDeath(%d,%d)",vehicleid, killerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	vehOnVehicleDeath(vehicleid, killerid);
	return 1;
}

public OnPlayerText(playerid, text[])
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerText(%d,\"%s\")",playerid, text);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	if(!IsPlayerConnectEx(playerid)) {
		return 0;
	}
	new ret = adminsOnPlayerText(playerid, text);
	if(ret == 2) {
		return 1;
	} else if(ret == 1) {
		return 0;
	}
	if(isMuted(playerid) && ~EAdminFlags:GetPVarInt(playerid, "AdminFlags") & EAdminFlags_Unbannable) {
		SendClientMessage(playerid, X11_TOMATO_2, "You are muted!");
		return 0;
	}
	newsOnPlayerText(playerid, text);
	RPOnPlayerText(playerid, text);
	return 0;
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerEnterVehicle(%d,%d,%d)",playerid, vehicleid, ispassenger);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	vehOnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
	acOnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerExitVehicle(%d,%d)",playerid, vehicleid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	seatbeltOnPlayerExitVehicle(playerid, vehicleid);
	drivebyOnPlayerExitVehicle(playerid, vehicleid);
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerStateChange(%d,%d,%d)",playerid, newstate, oldstate);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	setLastCarPVar(playerid, newstate, oldstate);
	acOnPlayerStateChange(playerid, newstate, oldstate);
	adminOnPlayerStateChange(playerid, newstate, oldstate);
	vehOnPlayerStateChange(playerid, newstate, oldstate);
	trainingOnPlayerStateChange(playerid, newstate, oldstate);
	govOnPlayerStateChange(playerid, newstate, oldstate);
	seatbeltOnPlayerStateChange(playerid, newstate, oldstate);
	racingOnPlayerStateChange(playerid, newstate, oldstate);
	drivebyOnPlayerStateChange(playerid, newstate, oldstate);
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerEnterCheckpoint(%d)",playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	jobOnPlayerEnterCheckpoint(playerid);
	govOnPlayerEnterCheckpoint(playerid);
	leoOnPlayerEnterCheckpoint(playerid);
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerLeaveCheckpoint(%d)",playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerEnterRaceCheckpoint(%d)",playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	trainingOnPlayerEnterRacePoint(playerid);
	govOnPlayerEnterCheckpoint(playerid);
	racingOnEnterCheckpoint(playerid);
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerLeaveRaceCheckpoint(%d)",playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	return 1;
}

public OnRconCommand(cmd[])
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnRconCommand(\"%s\")",cmd);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerRequestSpawn(%d)",playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	if(IsPlayerNPC(playerid)) return 1;
	if(!IsPlayerConnectEx(playerid)) {
		return 0;
	}
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

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

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

public OnVehicleMod(playerid, vehicleid, componentid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnVehicleMod(%d,%d,%d)",playerid,vehicleid, componentid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	acOnVehicleMod(playerid, vehicleid, componentid);
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnVehiclePaintjob(%d,%d,%d)",playerid, vehicleid, paintjobid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	vehOnVehiclePaintjob(vehicleid, playerid, paintjobid);
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnVehiclePaintjob(%d,%d,%d,%d)",playerid, vehicleid, color1, color2);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	vehOnVehicleRespray(playerid, vehicleid, color1, color2);
	return 1;
}

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

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerInteriorChange(%d,%d,%d)",playerid, newinteriorid, oldinteriorid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	DynamicStreamerIntCheck(playerid);
	updateSpectators(playerid);
	paintballOnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
	//checkSnow(playerid);
	TextDrawsOnPlayerEnterInterior(playerid, newinteriorid, oldinteriorid);
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerKeyStateChange(%d,%d,%d)",playerid, newkeys, oldkeys);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	keybindOnKeyStateChange(playerid, newkeys, oldkeys);
	animsOnKeyStateChange(playerid, newkeys, oldkeys);
	fishOnPlayerKeyState(playerid, newkeys, oldkeys);
	camsOnPlayerKeyState(playerid, newkeys, oldkeys);
	acOnKeyStateChange(playerid, newkeys, oldkeys);
	dbkeysOnPlayerKeyState(playerid, newkeys, oldkeys);
	basketballKeysOnPlayerKeyState(playerid, newkeys, oldkeys);
	cheatsOnPlayerKeyStateChange(playerid, newkeys, oldkeys);
	if(newkeys & KEY_SECONDARY_ATTACK)
	{
		new time = GetPVarInt(playerid, "EnterExitCooldown");
		new timenow = gettime();
		if(ENTEREXIT_COOLDOWN-(timenow-time) > 0) {
			return 1;
		}
		businessTryEnter(playerid);
		interiorTryEnterExit(playerid);
		familiesTryEnterExit(playerid);
		housesTryEnterExit(playerid);
		updateSpectators(playerid);
		factionTryEnterExit(playerid);
		iBizTryEnter(playerid);
		apartmentTryEnterExit(playerid);
		joiningOrLeavingBBall(playerid); //basketball
		SetPVarInt(playerid, "EnterExitCooldown", gettime());
	}
	if(newkeys & KEY_CTRL_BACK) {
		ShamalTryEnterExit(playerid);
	}
	if(newkeys & KEY_LOOK_BEHIND) {
		vehOnEngineTry(playerid);
	}
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	new msg[128];
	if(success) {
		format(msg, sizeof(msg), "AdmWarn: %s logged in via RCON",ip);
	} else {
		format(msg, sizeof(msg), "AdmWarn: %s failed to login via RCON",ip);
	}
	ABroadcast(X11_RED3,msg,EAdminFlags_ServerManager);
	return 1;
}

public OnPlayerUpdate(playerid)
{
	acOnPlayerUpdate(playerid);
	cheatsOnPlayerUpdate(playerid);
	if(IsPlayerConnectEx(playerid)) {
		//should be moved into a local variable
		if(GetPVarType(playerid, "Desynced") != PLAYER_VARTYPE_NONE) {
			return 0;
		}
		rpOnPlayerUpdate(playerid);
		new EAdminFlags:aflags = EAdminFlags:GetPVarInt(playerid, "AdminFlags");
		if(~aflags & EAdminFlags_AntiCheat) {
			if(AntiCBugOnPlayerUpdate(playerid) == 2) {
				return 0;
			}
		}
		camsOnPlayerUpdate(playerid);
		//damageSystemOnPlayerUpdate(playerid);
	} else return 0;
	return 1;
}

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

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

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

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

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(lastDialogInfo[playerid][0]++ == 0) {
		lastDialogInfo[playerid][1] = gettime();
	}
	
	if(lastDialogInfo[playerid][0] > MAX_CMDS_PER_SEC) {
		if(gettime()-lastDialogInfo[playerid][1] > CMD_RESET_TIME)  {
			lastDialogInfo[playerid][1] = gettime();
			lastDialogInfo[playerid][0] = 0;
		} else if(gettime()-lastDialogInfo[playerid][1] > MAX_CMDS_TIME) {
			format(dialogstr, sizeof(dialogstr), "AdmWarn: %s[%d] has been kicked for dialog response spamming: ID: %d Resp: %d ListItem: %d InputText: %s",GetPlayerNameEx(playerid, ENameType_CharName),playerid, dialogid,response, listitem, inputtext);
			ABroadcast(X11_YELLOW, dialogstr, EAdminFlags_BasicAdmin);
			KickEx(playerid, "Dialog Spamming");		
			return 1;
		}
	}
	if(dialogid >= EAccountDialog_Base && dialogid < EBusiness_Base) {
		if(accountOnDialogResponse(playerid, dialogid, response, listitem, inputtext) == 1) {
			return 1;
		}
	} else if(dialogid >= EBusiness_Base && dialogid < EJob_Base) {
		if(bOnDialogResponse(playerid, dialogid, response, listitem, inputtext) == 1) {
			return 1;
		}
	} else if(dialogid >= EJob_Base && dialogid < EAdminDialog_Base) {
		if(jobOnDialogResponse(playerid, dialogid, response, listitem, inputtext) == 1) {
			return 1;
		}
	} else if(dialogid >= EAdminDialog_Base && dialogid < EFamilyDialog_Base) {
		if(adminOnDialogResponse(playerid, dialogid, response, listitem, inputtext) == 1) {
			return 1;
		}
	} else if(dialogid >= EFamilyDialog_Base && dialogid < EPointDialog_Base) {
		if(familyOnDialogResponse(playerid, dialogid, response, listitem, inputtext) == 1) {
			return 1;
		}
	} else if(dialogid >= EPointDialog_Base && dialogid < EVIPShopDialog_Base) {
		//we don't handle responses from point dialogs atm
	} else if(dialogid >= EVIPShopDialog_Base && dialogid < EAccessoriesDialog_Base) {
		if(VIPOnDialogResponse(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EAccessoriesDialog_Base && dialogid < ERPDialog_Base) {
		if(accessoriesOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= ERPDialog_Base && dialogid < ETurfDialog_Base) {
		if(RPOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= ETurfDialog_Base && dialogid < EVehicles_Base) {
		//if(turfsOnDialogResponse(playerid, dialogid, response, listitem, inputtext)) {
			//return 1;
		//}
	} else if(dialogid >= EVehicles_Base && dialogid < EFactionsDialog_Base) {
		if(vehOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EFactionsDialog_Base && dialogid < EGovDialog_Base) {
		if(factionsOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	}  else if(dialogid >= EGovDialog_Base && dialogid < EPaintball_Base) {
		if(govOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EPaintball_Base && dialogid < ELockers_Base) {
		if(paintballOnDialogResponse(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	}else if(dialogid >= ELockers_Base && dialogid < EHelp_Base) {
		if(lockersOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	}else if(dialogid >= EHelp_Base && dialogid < EGPS_Base) {
		if(helpOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EGPS_Base && dialogid < EKeyBind_Base) {
		if(gpsOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EKeyBind_Base && dialogid < EIllegalBusiness_Base) {
		if(keybindOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EIllegalBusiness_Base && dialogid < ERacing_Base) {
		if(iBizOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= ERacing_Base && dialogid < EHouseFurniture_Base) {
		if(RacingOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EHouseFurniture_Base && dialogid < EGunFactory_Base) {
		if(HouseFurnOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= EGunFactory_Base && dialogid < EWallTag_Base) {
		//if(GunFactoryOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			//return 1;
		//}
	} else if(dialogid >= EWallTag_Base && dialogid < ECarToys_Base) {
		if(WallTagOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= ECarToys_Base && dialogid < ECheats_Base) {
		if(CarToysOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	} else if(dialogid >= ECheats_Base && dialogid < EDialogBase_End) {
		if(CheatsOnDialogResp(playerid, dialogid, response, listitem, inputtext)) {
			return 1;
		}
	}
	//EWallTag_Base EDialogBase_End
	return 0;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	new EAdminFlags:aflags = EAdminFlags:GetPVarInt(playerid, "AdminFlags");
	if(aflags & EAdminFlags_BasicAdmin) {
		if(!IsPlayerConnectEx(clickedplayerid)) {
			return 0;
		}
		if(source == CLICK_SOURCE_SCOREBOARD && playerid != clickedplayerid) {
			if(GetPVarType(playerid, "SpecX") == PLAYER_VARTYPE_NONE) {
				new Float:X, Float:Y, Float:Z, interior, vw;
				GetPlayerPos(clickedplayerid, X, Y, Z);
				interior = GetPlayerInterior(clickedplayerid);
				vw = GetPlayerVirtualWorld(clickedplayerid);
				SetPlayerPos(playerid, X, Y, Z);
				SetPlayerInterior(playerid, interior);
				SetPlayerVirtualWorld(playerid, vw);
				SendClientMessage(playerid, X11_ORANGE, "You have been teleported.");
			} else {
				format(query, sizeof(query), "/spectate player %d",clickedplayerid);
				Command_ReProcess(playerid, query, false);
			}
		}
	}
	return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[]) {
	
	if(isnull(cmdtext)) return 0;
	
	loggingOnPlayerCommand(playerid, cmdtext);
	
	if(lastCmdInfo[playerid][0]++ == 0) {
		lastCmdInfo[playerid][1] = gettime();
	}
	
	if(lastCmdInfo[playerid][0] > MAX_CMDS_PER_SEC) {
		if(gettime()-lastCmdInfo[playerid][1] > CMD_RESET_TIME)  {
			lastCmdInfo[playerid][1] = gettime();
			lastCmdInfo[playerid][0] = 0;
		} else if(gettime()-lastCmdInfo[playerid][1] > MAX_CMDS_TIME) {
			format(dialogstr, sizeof(dialogstr), "AdmWarn: %s[%d] has been kicked for command spamming: %s",GetPlayerNameEx(playerid, ENameType_CharName),playerid, cmdtext);
			ABroadcast(X11_YELLOW, dialogstr, EAdminFlags_BasicAdmin);
			KickEx(playerid, "Command Spamming");		
			return 0;
		}
	}
	if(isMuted(playerid) && ~EAdminFlags:GetPVarInt(playerid, "AdminFlags") & EAdminFlags_Unbannable) {
		SendClientMessage(playerid, X11_TOMATO_2, "You are muted!");
		return 0;
	}
	if(CheckText(cmdtext) == 0 && ~EAdminFlags:GetPVarInt(playerid, "AdminFlags") & EAdminFlags_ServerManager) {
		format(dialogstr, sizeof(dialogstr), "AdmWarn: %s[%d] may have just tried to advertise: %s",GetPlayerNameEx(playerid, ENameType_CharName),playerid, cmdtext);
		ABroadcast(X11_YELLOW, dialogstr, EAdminFlags_BasicAdmin);
		return -1;
	}
	if(!IsPlayerNPC(playerid)) {
		if(!IsPlayerConnectEx(playerid)) {
			//they haven't logged in, so don't process the command
			return -1;
		}
	}
	if(adminOnCmdRecieved(playerid, cmdtext) == 0) {
		SendClientMessage(playerid, X11_TOMATO_2, "You must be on admin duty to do this command.");
		return 0;
	}
	return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success) {
		SendClientMessage(playerid, X11_RED3, "Unknown command, try /help");
	}
	return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid) {
	businessPickupPickup(playerid, pickupid);
	jobsOnPickupPickup(playerid, pickupid);
	VIPOnPickupPickup(playerid, pickupid);
	RPOnPlayerPickupPickup(playerid, pickupid);
	accessoriesOnPlayerPickupPickup(playerid, pickupid);
	govOnPlayerPickupPickup(playerid, pickupid);
	return 1;
}
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
	accessoriesOnPlayerEditObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
}
public OnQueryError( errorid, error[], callback[], query[], connectionHandle ) {
	#if debug
		new msg[256];
		format(msg,sizeof(msg),"SQL ERROR: %d %s",errorid, error);
		printf(msg);
		ABroadcast(X11_RED, msg, EAdminFlags_All);
	#endif
	return 0;
}
allocMapID() {
	for(new i=0;i<sizeof(UsedMapIDs);i++) {
		if(UsedMapIDs[i] == 0) {
			UsedMapIDs[i] = 1;
			return i;
		}
	}
	return -1;
}
freeMapID(index) {
	if(index > sizeof(UsedMapIDs)) {
		return -1;
	}
	UsedMapIDs[index] = 0;
	return 0;
}
PreloadAnimLib(playerid, animlib[]) {
	ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0,0);
	return;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {
	factionsOnPlayerGiveDamage(playerid, damagedid, amount, weaponid);
	acOnPlayerGiveDamage(playerid, damagedid, amount, weaponid);
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) {
	boxingOnPlayerTakeDamage(playerid, issuerid, amount, weaponid);
	//damageSystemOnPlayerTakeDamage(playerid, issuerid, amount, weaponid);
}
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) {
//	accessoriesOnEditObject(playerid, playerobject, objectid, response, fX, fY, fZ, fRotX, fRotY, fRotZ);
	return 1;
}
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ) {
}
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) {
	safesOnPlayerEditObject(playerid, objectid, response, x, y, z, rx, ry, rz);
	houseFurnOnPlayerEditObject(playerid, objectid, response, x, y, z, rx, ry, rz);
	leoOnPlayerEditObject(playerid, objectid, response, x, y, z, rx, ry, rz);
	walltagsOnPlayerEditObject(playerid, objectid, response, x, y, z, rx, ry, rz);
	carToysOnEditObject(playerid, objectid, response, x, y, z, rx, ry, rz);
	Streamer_Update(playerid);
}
public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z) {
	walltagsOnPlayerSelectObject(playerid, objectid, modelid, x, y, z);
	safesOnPlayerSelectObject(playerid, objectid, modelid, x, y, z);
	houseFurnOnPlayerSelectObject(playerid, objectid, modelid, x, y, z);
	leoOnPlayerSelectObject(playerid, objectid, modelid, x, y, z);
	cartoysOnPlayerSelectObject(playerid, objectid, modelid, x, y, z);
	Streamer_Update(playerid);
}
public OnEnterExitModShop(playerid, enterexit, interiorid) {
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnEnterExitModShop(%d,%d,%d)", playerid, enterexit, interiorid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	return 1;
}
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnPlayerClickMap(%d,%f,%f,%f)", playerid, fX, fY, fZ);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	new EAdminFlags:aflags = EAdminFlags:GetPVarInt(playerid, "AdminFlags");
	if(aflags & EAdminFlags_BasicAdmin) {
		SetPlayerPosFindZ(playerid, fX, fY, fZ); 
		SetPlayerInterior(playerid, 0);
		SetPlayerVirtualWorld(playerid, 0);
		SendClientMessage(playerid, X11_TOMATO_2, "You have been teleported.");
	}
    return 1;
}
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat) { 
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnUnoccupiedVehicleUpdate(%d,%d,%d)", vehicleid, playerid, passenger_seat);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	return 1;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
	#if dbg-callbacks
		format(query, sizeof(query), "DBG: OnVehicleDamageStatusUpdate(%d,%d)", vehicleid, playerid);
		SendClientMessageToAll(X11_YELLOW, query);
	#endif
	return 1;
}
task SystemTimer[1000]() {
	checkAJail();
	checkAFK();
	checkPayday();
	JailTimer();
	DiseaseTimer();
	leoSysTimer();
	CheckGates();
	checkCarRadios();
	checkJobsTime();
	checkDrivingTestTimer();
	vehicleMileAgeTimer();
	updatePlayerMapLocations();
	//checkCustomPrivateRadios();
}
task ChargeTimer[15000]() {
	//used for things which msg the user
	doTaxiCharges();
	//destroyAllOldEvidence();
}
task SellTimer[21600000]() {
	sellInactiveHouses();
	sellInactiveBusinesses();
}
public OnPlayerEnterDynamicArea(playerid, areaid) {
	//weatherOnPlayerEnterDynamicArea(playerid, areaid);
}
public OnPlayerLeaveDynamicArea(playerid, areaid) {
	//weatherOnPlayerLeaveDynamicArea(playerid, areaid);
}
Reply

Looking to help someone out!

- Willing to help with CNR Servers or stunt/dm/drift/freeroam servers.

PM me for my skype
Reply

*not any longer*
Reply

Looking for a scripter.

Problem
Quote:

samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed.

SERVER IP: server.lsc-rp.net:7802
TEAMSPEAK IP: ts.lsc-rp.net:9988
WEBSITE: www.lsc-rp.net

All is hosted
Reply

how to convert dini full package too Y_INI i realy need help PM me if you want to help me please

Also here

Код:
//*********** CUBIC WORLD********//

//Game Mode version - 1.0 BETA
//pasha97 aka Pavel Chernyshov
//2013-2013
//Voronezh, Russia
//Skype: pasha.97.97
//All rights reserved

#include <a_samp>
#include <a_http>
#include <streamer>
#include <dini>
#include <MPM>
#include <sscanf2>
#include <zcmd>
#pragma tabsize 0


//***********Variables and defines which can bee edited for some reason********//
#define PRINT_LOADING_INFO //if you define it, server will print to console the process of loading blocks, safe zones etc

#define MAX_BLOCKS 5000//Max amount of blocks on the server
#define MAX_ZONES 100//Max amount of zones on the server
#define MAX_LABELS 100//Max amount of labels on the server

#define MAPFILE "GLOBAL_MAP.sav"//File of saved map
#define ZONESFILE "SAFE_ZONES.sav"//File of safe zones
#define LABELSFILE "LABELS.sav"//File of safe labels
#define USERFILE "Users/%s.sav"//File of saved map

#define BOUND_MAX_X 5295.6675//Some config for player bounds
#define BOUND_MIN_X 4703.5796//Some config for player bounds
#define BOUND_MAX_Y 1372.4235//Some config for player bounds
#define BOUND_MIN_Y 626.7107//Some config for player bounds

#define BUTTON_SWITCH_T "C"//Text for switch button
#define BUTTON_DISABLE_T "F"//Text for disable button
#define BUTTON_PUT_T "RMB"//Text for put button
#define BUTTON_DESTROY_T "LMB"//Text for destroy button
#define BUTTON_ROTATE_T "Y"//text for rotation button

#define COLOR_RED         0xFF0000C8
#define COLOR_WHITE       0xFFFFFFC8
#define COLOR_YELLOW      0xDFF709C8
#define COLOR_GREEN       0x09F709C8
#define COLOR_BLUE        0x0000FFC8

#define BUTTON_SWITCH KEY_CROUCH//The switch button
#define BUTTON_DISABLE KEY_SECONDARY_ATTACK//The disable button
#define BUTTON_PUT KEY_HANDBRAKE//The put button
#define BUTTON_DESTROY KEY_FIRE//The destroy button
#define BUTTON_ROTATE KEY_YES//The rotate decoration button

#define CUBE_SIZE_WIDE 1.76//Size of the cube on wide
#define CUBE_SIZE_HEIGH 1.5//size of the cube on heigh

#define KOEF 4//by what value the cube heigh size must be multipled to reach the terrain
#define SCALE 10//the maximum distance to put/destroy block
#define MIN_SCALE 5//the minimum distance to put block
#define MIN_SCALE_DES 3//the minimum distance to destroy block

#define BASE_MODEL 4242//model of the terrain
#define BASE_SIZE_X 199.4//X size of terrain
#define BASE_SIZE_Y 251.3//Y size of terrain
#define BASE_PLACE_X 5000//The center of terrain(X)
#define BASE_PLACE_Y 1000//The center of terrain(Y)
#define BASE_PLACE_Z 5.2//The center of terrain(Z)
#define BASE_COLOR 0xFFccff00//The color of terrain(X)
#define BASE_TX_MODEL -1//The model of the object which has the needed texture for terrain
#define BASE_TX_TXD "none"//The name of TXD file for terrain texture
#define BASE_TX_TEXTURE "none"//The name of terrain textute

#define PUT_FLOOD_SECONDS 1000//the minimum time in mileseconds between putting blocks
#define DES_FLOOD_SECONDS 500//the minimum time in mileseconds between destroying blocks

//***********System Variables and defines which do not need to be edited********//

new timer[MAX_PLAYERS];

new Zone[MAX_PLAYERS][2];
new Text3D:Label[MAX_PLAYERS];
new Label_ID[MAX_PLAYERS];
new pname[MAX_PLAYER_NAME];
new Float:BlockX[MAX_BLOCKS];
new Float:BlockY[MAX_BLOCKS];
new Float:BlockZ[MAX_BLOCKS];
new BlockAdd[MAX_BLOCKS];
new LastBlock[MAX_PLAYERS][2];
//new curveh[MAX_PLAYERS];
//new curveh2[MAX_PLAYERS];

native WP_Hash(buffer[], len, const str[]);

#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) \
	(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
#define HOLDING(%0) \
	((newkeys & (%0)) == (%0))
#define SetPlayerTimer(%0,%1,%2) SetTimerEx(%0,%1,%2,"i",playerid)

#define colorlist 93745
#define glasslist 14455
#define DIALOGID 2000
#define DECORATIONS_ID 2000

new stringu[1024];
new switchlist;
new naturelist;
new woodlist;
new stonelist;
new fencinglist;
new decorationslist;
new plantslist;


new BlockHold[MAX_PLAYERS];
new BlockID[MAX_PLAYERS];
new Pointer[MAX_PLAYERS];
new RotDec[MAX_PLAYERS];
new SAVED[MAX_BLOCKS];
new SAVED_ZONE[MAX_ZONES];
new Text3D:SAVED_LABEL[MAX_LABELS];
new Text:Center;

new Text:Logo;
new Text:Tips;


new PlayerText:BLOCKINFO[MAX_PLAYERS];
new PutFlood[MAX_PLAYERS];
new DesFlood[MAX_PLAYERS];

#define DOOR_1 1491
#define DOOR_2 1502
#define SIGN 3927
#define SIGN_ID DECORATIONS_ID+5

#define DOOR_RAM_MODEL 19397

#define DOOR_RIGHT_X 0.7800
#define DOOR_RIGHT_Y 0.0
#define DOOR_RIGHT_Z 1.7600
#define DOOR_RIGHT_ROT_X 0
#define DOOR_RIGHT_ROT_Y 0
#define DOOR_RIGHT_ROT_Z 90

#define DOOR_LEFT_X (-0.2930)
#define DOOR_LEFT_Y 0.0
#define DOOR_LEFT_Z 1.2048
#define DOOR_LEFT_ROT_X 90
#define DOOR_LEFT_ROT_Y 0
#define DOOR_LEFT_ROT_Z 0



#define DOOR_UP_X 0.7678
#define DOOR_UP_Y 0
#define DOOR_UP_Z 2.730
#define DOOR_UP_ROT_X 0
#define DOOR_UP_ROT_Y 90
#define DOOR_UP_ROT_Z -90



#define SIGN_RAM_MODEL 2258

#define SIGN_RIGHT_X (-0.24)
#define SIGN_RIGHT_Y (-0.07)
#define SIGN_RIGHT_Z 0.75
#define SIGN_RIGHT_ROT_X 0
#define SIGN_RIGHT_ROT_Y 0
#define SIGN_RIGHT_ROT_Z 0


new CUBE_MODEL[] =//Array which has object id of all cubes
{
1685,//grass
1685,//ground
1685,//rock
1685,//water
1685,//sand
1685,//lava
1685,//ice

1685,//wood1
1685,//wood2
1685,//wood3

1685,//stone
1685,//stone
1685,//stone
1685,//stone
1685,//stone
1685,//stone
1685,//stone

1685,//bark

1685,//new wood
1685,//new wood
1685,//new wood
1685,//new wood

1685,//black
1685,//white
1685,//red
1685,//orange
1685,//yellow
1685,//green
1685,//green-blue
1685,//blue
1685,//Purple

1685,//white
1685,//red
1685,//orange
1685,//yellow
1685,//green
1685,//green-blue
1685,//blue
1685,//Purple


1685,//fencing
1685,//fencing
1685,//fencing
};


new CUBE_NAME[][] =//array with cubes names
{
"Grass",
"Ground",
"Rock",
"Water",
"Sand",
"Lava",
"Ice",

"Wood 1",
"Wood 2",
"Wood 3",

"Stone 1",
"Stone 2",
"Stone 3",
"Stone 4",
"Stone 5",
"Stone 6",
"Stone 7",

"Tree Bark",

"Wood 4",
"Wood 5",
"Wood 6",
"Wood 7",

"Black",
"White",
"Red",
"Orange",
"Yellow",
"Green",
"Green-Blue",
"Blue",
"Purple",

"White Glass",
"Red Glass",
"Orange Glass",
"Yellow Glass",
"Green Glass",
"Green-Blue Glass",
"Blue Glass",
"Purple Glass",


"Fencing 1",
"Fencing 2",
"Fencing 3"
};

new DECO_NAME[][]=//array with decorations names
{
"Chair 1",
"Chair 2",
"Armchair",
"Tabel 1",
"Fencing 1",
"Sign",
"Bed 1",
"Cabinet 1",
"Cabinet 2",
"Cabinet 3",
"Stairs",
"Door 1",
"Door 2",
"Streetlight",
"Fencing 2",

"Tree 1",
"Tree 2",
"Tree 3",
"Tree 4",
"Tree 5",
"Tree 6",
"Tree 7",
"Grass 1",
"Grass 2",
"Grass 3",
"Flowers 1",
"Flowers 2"
};

new cmodel[] =//array for changing cubes textures
{
17880,//grass
16134,//ground
898,//rock
3951,//water
16202,//sand
898,//lava
898,//ice

1224,//wood1
3260,//wood3
2988,//wood6

4724,//stone
19355,//stone
19364,//stone
19357,//stone
19359,//stone
19363,//stone
19371,//stone

832,//bark

19376,//new wood
19378,//new wood
19379,//new wood
19356,//new wood

19357,//black
19357,//white
19357,//red
19357,//orange
19357,//yellow
19357,//green
19357,//green-blue
19357,//blue
19357,//Purple

19466,//white
19466,//red
19466,//orange
19466,//yellow
19466,//green
19466,//green-blue
19466,//blue
19466,//Purple


983,//fencing
3282,//fencing
4100,//fencing
};

new ctxd[][] =//array for changing cubes textures
{
"landhub",//grass
"desert",//ground
"underwater",//rock
"rczero_track",//water
"des_cen",//sand
"underwater",//lava
"underwater",//ice


"boxes",//wood1
"country_breakable",//wood3
"kcomp_gx",//wood6

"skyscr1_lan2",//stone
"all_walls",//stone
"all_walls",//stone
"all_walls",//stone
"all_walls",//stone
"all_walls",//stone
"all_walls",//stone

"gta_brokentrees",//bark

"all_walls",//new wood
"all_walls",//new wood
"all_walls",//new wood
"all_walls",//new wood

"all_walls",//black
"all_walls",//white
"all_walls",//red
"all_walls",//orange
"all_walls",//yellow
"all_walls",//green
"all_walls",//green-blue
"all_walls",//blue
"all_walls",//Purple

"lsmall_shops",//white
"lsmall_shops",//red
"lsmall_shops",//orange
"lsmall_shops",//yellow
"lsmall_shops",//green
"lsmall_shops",//green-blue
"lsmall_shops",//blue
"lsmall_shops",//Purple


"bar_chainlink",//fencing
"country_breakable",//fencing
"lanfireesc_tr"//fencing
};

new ctexture[][] =//array for changing cubes textures
{
"yardgrass1",//grass
"des_redrock1",//ground
"greyrockbig",//rock
"waterclear256",//water
"des_ripplsand",//sand
"greyrockbig",//lava
"greyrockbig",//ice

"crate128",//wood1
"des_ghotwood1",//wood3
"kmwood_gate",//wood6

"sl_librarywall1",//stone
"ab_corWallUpr",//stone
"mp_carter_bwall",//stone
"cj_white_wall2",//stone
"copbtm_brown",//stone
"motel_wall3",//stone
"stormdrain3_nt",//stone

"CJ_bark",//bark

"gym_floor5",//new wood
"mp_diner_woodwall",//new wood
"mp_shop_floor2",//new wood
"CJ_LIGHTWOOD",//new wood

"cj_white_wall2",//black
"cj_white_wall2",//white
"cj_white_wall2",//red
"cj_white_wall2",//orange
"cj_white_wall2",//yellow
"cj_white_wall2",//green
"cj_white_wall2",//green-blue
"cj_white_wall2",//blue
"cj_white_wall2",//Purple


"lsmall_window01",//white
"lsmall_window01",//red
"lsmall_window01",//orange
"lsmall_window01",//yellow
"lsmall_window01",//green
"lsmall_window01",//green-blue
"lsmall_window01",//blue
"lsmall_window01",//Purple

"awirex2",//fencing
"Gen_Meshfencing",//fencing
"Upt_Fence_Mesh"//fencing//fencing
};

new ccolor[] =//array for changing cubes textures
{
0xFF7FFF00,//grass
0xFF834E1D,//ground
0xFFD5D5D5,//rock
0xEE008CF0,//water
0xFFFFF5B0,//sand
0xFFE32636,//lava
0x907FFFD4,//ice


0xFFFFFFFF,//wood1
0xFFFFFFFF,//wood2
0xFFFFFFFF,//wood3

0xFFFFFFFF,//stone
0xFFFFFFFF,//stone
0xFFFFFFFF,//stone
0xFFFFFFFF,//stone
0xFFFFFFFF,//stone
0xFFFFFFFF,//stone
0xFFFFFFFF,//stone

0xFFFFFFFF,//bark

0xFFFFFFFF,//wood
0xFFFFFFFF,//wood
0xFFFFFFFF,//wood
0xFFFFFFFF,//wood

0xFF000000,//black
0,//white
0xFFFF0000,//red
0xFFffa500,//orange
0xFFFFFF00,//yellow
0xFF00FF00,//green
0xFF00ffa0,//green-blue
0xFF0047ab,//blue
0xFFFF00FF,//Purple

0xFFFFFFFF,//white
0xFFFF0000,//red
0xFFffa500,//orange
0xFFFFFF00,//yellow
0xFF00FF00,//green
0xFF00ffa0,//green-blue
0xFF3636cc,//blue
0xFFFF00FF,//Purple


0xFFFFFFFF,//fencing
0xFFFFFFFF,//fencing
0xFFFFFFFF,//fencing
};


new DECO_MODEL[] =//Array which has object id of all decorations
{
1671,//chair
1720,//chair2
1711,//armchair
2635,//tabel2
1408,//fencing
3927,//sign
1802,//bed3
912,//cabinet1
2204,//cabinet2
2328,//cabinet3
3361,//stairs
1491,//door1
1502,//door2
1223,//Streetlight
970,//fencing 2

617,//tree
659,//tree
673,//tree
732,//tree
3506,//tree
736,//tree
685,//tree
820,//grass
821,//grass
19473,//grass
869,//flowers
870//flowers
};
new Float:DECO_Z_INDEX[] =//Array which has value which must be added to Z corrdinate decor
{
-0.3,//chair
-0.7,//chair2
-0.8,//armchair
-0.5,//table2
0.0,//fencing
1.3,//sign
-0.6,//bed3
-0.3,//cabinet1
-0.7,//cabinet2
-0.7,//cabinet3
-1.3,//stairs
-0.7,//door1
-0.7,//door2
-0.9,//Streetlight
-0.1,//fencing2

-1.5,//tree
-1.5,//tree
-1.5,//tree
-1.5,//tree
-1.5,//tree
9.4,//tree
-1.5,//tree
-0.9,//grass
-0.9,//grass
-0.9,//grass
-0.4689,//flowers
-0.6724//flowers
};
new Float:DECO_X_INDEX[] =//Array which has value which must be added to X corrdinate decor
{
0.0,//chair
0.0,//chair2
0.0,//armchair
0.0,//table2
0.0,//fencing
0.0,//sign
-0.5,//bed3
0.0,//cabinet1
-1.1,//cabinet2
0.0,//cabinet3
2.0,//stairs
-0.8,//door1
-0.8,//door2
0.0,//Streetlight
0.0,//fencing2

0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//grass
0.0,//grass
0.0,//grass
0.0,//flowers
0.0//flowers
};
new Float:DECO_Y_INDEX[] =//Array which has value which must be added to Z corrdinate of decor
{
0.0,//chair
0.0,//chair2
0.0,//armchair
0.0,//table2
0.0,//fencing
0.0,//sign
-2.0,//bed3
0.0,//cabinet1
0.0,//cabinet2
-1.1,//cabinet3
0.0,//stairs
0.0,//door1
0.0,//door2
0.0,//Streetlight
0.0,//fencing2

0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//tree
0.0,//grass
0.0,//grass
0.0,//grass
0.0,//flowers
0.0//flowers
};


new cnames[][] =//names of blocks in the selection menu
{
"Natural",
"Wood",
"Facing/stone",
"Colorful",
"Glass",
"Fencing",
"Decorations",
"Plants/treese",
"Disable"
};

new wnames[][] =//names of blocks in the selection menu
{
"Wood 1",
"Wood 2",
"Wood 3",
"Wood 4",
"Wood 5",
"Wood 6",
"Wood 7"
};

new snames[][] =//names of blocks in the selection menu
{
"Stone 1",
"Stone 2",
"Stone 3",
"Stone 4",
"Stone 5",
"Stone 6",
"Stone 7"
};

new colnames[][] =//names of blocks in the selection menu
{
"Black",
"White",
"Red",
"Orange",
"Yellow",
"Green",
"Green-Blue",
"Blue",
"Purple"
};

new gnames[][] =//names of blocks in the selection menu
{
"Simple",
"Red",
"Orange",
"Yellow",
"Green",
"Green-Blue",
"Blue",
"Purple"
};

new fnames[][] =//names of blocks in the selection menu
{
"Fencing 1",
"Fencing 2",
"Fencing 3"
};

new nnames[][] =//names of blocks in the selection menu
{
"Grass",
"Ground",
"Rock",
"Water",
"Sand",
"Lava",
"Ice",
"Tree Bark"
};

new dnames[][] =//names of decorations in the selection menu
{
"Chair 1",
"Chair 2",
"Armchair",
"Tabel 1",
"Fencing 1",
"Sign",
"Bed 1",
"Cabinet 1",
"Cabinet 2",
"Cabinet 3",
"Stairs",
"Door 1",
"Door 2",
"Streetlight",
"Fencing 2"
};

new pnames[][] =//names of plants in the selection menu
{
"Tree 1",
"Tree 2",
"Tree 3",
"Tree 4",
"Tree 5",
"Tree 6",
"Tree 7",
"Grass 1",
"Grass 2",
"Grass 3",
"Flowers 1",
"Flowers 2"
};

new colcolors[]=//Colors of blocks in the selection menu
{
0x000000FF,//black
0xFFFFFFFF,//white
0xFF0000FF,//red
0xffa500FF,//orange
0xFFFF00FF,//yellow
0x00FF00FF,//green
0x00ffa0FF,//green-blue
0x3636ccFF,//blue
0xFF00FFFF//Purple
};
new gcolors[]=//Colors of blocks in the selection menu
{
0xFFFFFF44,//white
0xFF000044,//red
0xffa50044,//orange
0xFFFF0044,//yellow
0x00FF0044,//green
0x00ffa044,//green-blue
0x3636cc44,//blue
0xFF00FF44//Purple
};

#define SPD ShowPlayerDialog
#define REG_DIALOG 2334
#define LOG_DIALOG 2335

//WARNING!!! This defines can NOT be changed!
//No one can prevent you from doing it, but if you are a honest person, you won't change theese defines!
#define	NICK "[MWF]Gangster"
#define FULL_NAME "Micheal Jackson"
#define COPYRIGHT_DATE "2013-2014"
#define	LOCATION "USA"
#define	SKYPE "Hidden"
#define CREDITS "JordanLow\nWantedBoy\nRaiden\nShahryar\nAnd Many Others"
#define CREDITS_2 "Kalcor\nDracoBlue\nY_Less\nTotto8492\nD0efler\nIncognito"

//******End of variables and defines*********//

main()
{
return 1;
}
public OnPlayerConnect(playerid)
{
	BLOCKINFO[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 379.750091, "Selected block:~n~lolxd");
	PlayerTextDrawLetterSize(playerid, BLOCKINFO[playerid], 0.449999, 1.600000);
	PlayerTextDrawTextSize(playerid, BLOCKINFO[playerid], 634.599792, 480.399658);
	PlayerTextDrawAlignment(playerid, BLOCKINFO[playerid], 1);
	PlayerTextDrawColor(playerid, BLOCKINFO[playerid], -1);//
	PlayerTextDrawUseBox(playerid, BLOCKINFO[playerid], true);
	PlayerTextDrawBoxColor(playerid, BLOCKINFO[playerid], -2147483393);//
	PlayerTextDrawSetShadow(playerid, BLOCKINFO[playerid], 0);
	PlayerTextDrawSetOutline(playerid, BLOCKINFO[playerid], 1);//
	PlayerTextDrawBackgroundColor(playerid, BLOCKINFO[playerid], -1523963137);
	PlayerTextDrawFont(playerid, BLOCKINFO[playerid], 1);
	PlayerTextDrawSetProportional(playerid, BLOCKINFO[playerid], 1);//
	GameTextForPlayer(playerid,"~w~Welcome to ~r~MWF ~w~server!",5000,5);

 	 new giocatore[MAX_PLAYER_NAME];

    GetPlayerName(playerid, giocatore, sizeof(giocatore));
    format(stringu, sizeof(stringu), "{ffffff}%s (ID: %d)  {ffcc00}has joined {ff0000}MineCraft World Of Fun! ", giocatore, playerid);
    SendClientMessageToAll(0xFFFFFF, stringu);

	SendClientMessage(playerid, 0xFFFFFFFF,"{ffcc00}~~~~~~~~~~~~~~~~~~~~~~~~~{000000}~~~~~~~~~~~~~{ffcc00}~~~~~~~~~~~~~~~~~~~~~~~");
    SendClientMessage(playerid, 0xFFFFFFFF,"{00ff00}Welcome to {f50000}MineCraft World Of Fun!");
    SendClientMessage(playerid, 0xFFFFFFFF,"{00ff00}It's a Place Where You Can Show Your Imagination And Build Great Buildings With Your Friends!");
    SendClientMessage(playerid, 0xFFFFFFFF,"{00ff00}MineCraft World Of Fun Is Just A Server Created Just Like MineCraft But some Function will not like!");
    SendClientMessage(playerid, 0xFFFFFFFF,"{00ff00}We Have You Enjoy MineCraft World Of Fun! ,Regards MWF Admins");
	SendClientMessage(playerid, 0xFFFFFFFF,"{ffcc00}~~~~~~~~~~~~~~~~~~~~~~~~~{000000}~~~~~~~~~~~~~{ffcc00}~~~~~~~~~~~~~~~~~~~~~~~");
	PlayerPlaySound(playerid,1185,0,0,0);
	BlockHold[playerid]=0;

	BlockID[playerid]=-1;

	SetDynamicObjectMaterial(Pointer[playerid], 0, -1, "none", "none", 0x91FF0000);
	timer[playerid]=SetPlayerTimer("UpdateCubes",2000,1);
	
	PutFlood[playerid]=0;
	DesFlood[playerid]=0;
	RotDec[playerid]=0;
	Zone[playerid][0]=-1;
	Zone[playerid][1]=-1;
	Label[playerid]=Text3D:-1;
	Label_ID[playerid]=-1;
	LastBlock[playerid][0]=-1;
	LastBlock[playerid][1]=-1;

	

	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new giocatore[MAX_PLAYER_NAME];
    GetPlayerName(playerid, giocatore, sizeof(giocatore));
    switch(reason)
    {
    case 0: format(stringu, sizeof(stringu), "{ffffff}%s (ID: %d)  {ffcc00}has left the server! {ff0000}(Crash)", giocatore, playerid);
    case 1: format(stringu, sizeof(stringu), "{ffffff}%s (ID: %d)  {ffcc00}has left the server! {ff0000}(Left)", giocatore, playerid);
    case 2: format(stringu, sizeof(stringu), "{ffffff}%s (ID: %d)  {ffcc00}has left the server! {ff0000}(Kicked)", giocatore, playerid);
    }
    SendClientMessageToAll(0xFFFFFFFF, stringu);
    DestroyDynamicObject(Pointer[playerid]);
    TextDrawHideForPlayer(playerid,Center);
    TextDrawHideForPlayer(playerid,Logo);
    TextDrawHideForPlayer(playerid,Tips);
    PlayerTextDrawHide(playerid,BLOCKINFO[playerid]);
	KillTimer(timer[playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,BASE_PLACE_X, BASE_PLACE_Y, BASE_PLACE_Z+2);

				GameTextForPlayer(playerid, "~r~Wait! ~g~Loading objects!", 2500, 3);
				TogglePlayerControllable(playerid,0);
			    SetPlayerTimer("Unfreeze",3000,0);
			    SetPlayerHealth(playerid,10000000);
			    SetPlayerAttachedObject(playerid, 0, 18635, 6, -0.015000, 0.015000, 0.041999, -5.900000, -12.000002, 0.000000);
			    

			    
			   

	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
   	return 1;
}



public OnPlayerRequestClass(playerid, classid)
{	SetPlayerPos(playerid,2011.0867,1357.0909,10.8203);
	SetPlayerFacingAngle(playerid, 279.5659);
	SetPlayerCameraPos(playerid,2017.8021,1356.7081,12.1);
	SetPlayerCameraLookAt(playerid,2011.0867,1357.0909,10.8203,CAMERA_MOVE);
	return 1;
}
public OnPlayerRequestSpawn(playerid)
{
	if(!IsPlayerRegistered(playerid))
	{
		SPD(playerid, DIALOGID+REG_DIALOG, DIALOG_STYLE_PASSWORD, "MWF-Register", "{ff00ff}Hello! {00ff00}Welcome To MineCraft World Of Fun Server, Please Register To Join The MineCraft And Let's Have Fun", "..::Ok::..", "");
		return 0;
	}
	else
	{
	    if(IsIpMatch(playerid)) Login(playerid);
	    else
		{
		SPD(playerid, DIALOGID+LOG_DIALOG, DIALOG_STYLE_PASSWORD, "MWF-Login", "{ff00ff}Welcome Back To MineCraft World Of Fun \n {00ff00}To Join The Server Preass Your Password Below To Login.", "..::Ok::..", "");
		return 0;
		}
	}
    PlayerPlaySound(playerid,1186,0,0,0);
    HTTP(playerid, HTTP_GET, "192.168.0.101:7775", "", "PlayRadio");
    TextDrawShowForPlayer(playerid,Center);
    TextDrawShowForPlayer(playerid,Logo);
    TextDrawShowForPlayer(playerid,Tips);
	PlayerTextDrawShow(playerid,BLOCKINFO[playerid]);
    
    
	return 1;
}
public OnGameModeInit()
{
	print("\n----------------------------------");
	print("WAIT! LOADING SERVER!\n");
	print("----------------------------------\n");
	SetGameModeText("Creative•Minecraft");
	SendRconCommand("mapname Made by our players");
	SendRconCommand("hostname •• ••©MineCraft World Fun™ 0.3x•• ••");
	ShowPlayerMarkers(1);
	ShowNameTags(1);
	SetWeather(1);
	UsePlayerPedAnims();
	Streamer_VisibleItems(STREAMER_TYPE_OBJECT, 5000);
	Streamer_MaxItems(STREAMER_TYPE_OBJECT, 5000);
	

Center = TextDrawCreate(330.046386, 215.041732, "|");
TextDrawLetterSize(Center, 0.415328, 2.235836);
TextDrawAlignment(Center, 2);
TextDrawColor(Center, 0xFFFFFF);
TextDrawSetShadow(Center, 0);
TextDrawSetOutline(Center, 0);
TextDrawBackgroundColor(Center, 51);
TextDrawFont(Center, 0);
TextDrawSetProportional(Center, 1);


Logo = TextDrawCreate(316.799804, 431.141510, "~b~MineCraft ~h~World ~h~Of Fun ~w~v1.0 ~g~BETA        ~r~For more info - ~p~/help");
TextDrawLetterSize(Logo, 0.449999, 1.600000);
TextDrawTextSize(Logo, 469.000000, 644.582092);
TextDrawAlignment(Logo, 2);
TextDrawColor(Logo, -1);
TextDrawUseBox(Logo, true);
TextDrawBoxColor(Logo, 1431655850);
TextDrawSetShadow(Logo, 0);
TextDrawSetOutline(Logo, 1);
TextDrawBackgroundColor(Logo, 255);
TextDrawFont(Logo, 1);
TextDrawSetProportional(Logo, 1);


Tips = TextDrawCreate(8.011749, 219.566619, "~g~Useful keys:~n~~y~~k~~PED_DUCK~ - ~p~Switch blocks~n~~y~~k~~PED_LOCK_TARGET~ - ~p~Put block~n~~y~~k~~PED_FIREWEAPON~ - ~p~Destroy block~n~~y~~k~~VEHICLE_ENTER_EXIT~ - ~p~Disable selection~n~~y~~k~~CONVERSATION_YES~ - ~p~Rotate decoration");
TextDrawLetterSize(Tips, 0.449999, 1.600000);
TextDrawTextSize(Tips, 182.500000, -65.916694);
TextDrawAlignment(Tips, 1);
TextDrawColor(Tips, -1);
TextDrawUseBox(Tips, true);
TextDrawBoxColor(Tips, 1717985587);
TextDrawSetShadow(Tips, 0);
TextDrawSetOutline(Tips, 1);
TextDrawBackgroundColor(Tips, 286340010);
TextDrawFont(Tips, 1);
TextDrawSetProportional(Tips, 1);


	AddPlayerClass(260,BASE_PLACE_X, BASE_PLACE_Y, BASE_PLACE_Z+2,270.1425,0,0,0,0,-1,-1);

	for(new i=0; i<300;i++)
	{
	AddPlayerClass(i,BASE_PLACE_X, BASE_PLACE_Y, BASE_PLACE_Z+2,270.1425,0,0,0,0,-1,-1);
	}
	new idx;
	for(new i=0; i<2;i++)
	{
	//1 side
		idx=CreateObject(BASE_MODEL, BASE_PLACE_X + (BASE_SIZE_X*i), BASE_PLACE_Y, BASE_PLACE_Z,  0.00, 0.00, 0.00);
		SetObjectMaterial(idx, 0, BASE_TX_MODEL, BASE_TX_TXD, BASE_TX_TEXTURE, BASE_COLOR);
		if(i!=0)
		{
		idx=CreateObject(BASE_MODEL, BASE_PLACE_X - (BASE_SIZE_X*i), BASE_PLACE_Y, BASE_PLACE_Z,  0.00, 0.00, 0.00);
		SetObjectMaterial(idx, 0, BASE_TX_MODEL, BASE_TX_TXD, BASE_TX_TEXTURE, BASE_COLOR);
		}
	    
		for(new d=1;d<2;d++)
		{
		idx=CreateObject(BASE_MODEL, BASE_PLACE_X + (BASE_SIZE_X*i), BASE_PLACE_Y + (BASE_SIZE_Y*d), BASE_PLACE_Z,  0.00, 0.00, 0.00);
		SetObjectMaterial(idx, 0, BASE_TX_MODEL, BASE_TX_TXD, BASE_TX_TEXTURE, BASE_COLOR);
		idx=CreateObject(BASE_MODEL, BASE_PLACE_X + (BASE_SIZE_X*i), BASE_PLACE_Y - (BASE_SIZE_Y*d), BASE_PLACE_Z,  0.00, 0.00, 0.00);
		SetObjectMaterial(idx, 0, BASE_TX_MODEL, BASE_TX_TXD, BASE_TX_TEXTURE, BASE_COLOR);
		
		idx=CreateObject(BASE_MODEL, BASE_PLACE_X - (BASE_SIZE_X*i), BASE_PLACE_Y + (BASE_SIZE_Y*d), BASE_PLACE_Z,  0.00, 0.00, 0.00);
		SetObjectMaterial(idx, 0, BASE_TX_MODEL, BASE_TX_TXD, BASE_TX_TEXTURE, BASE_COLOR);
		idx=CreateObject(BASE_MODEL, BASE_PLACE_X - (BASE_SIZE_X*i), BASE_PLACE_Y - (BASE_SIZE_Y*d), BASE_PLACE_Z,  0.00, 0.00, 0.00);
		SetObjectMaterial(idx, 0, BASE_TX_MODEL, BASE_TX_TXD, BASE_TX_TEXTURE, BASE_COLOR);

		}
		
	

	}
	#if defined PRINT_LOADING_INFO
	print("Terrain loaded!\n");
	#endif
	
	
	switchlist = LoadMPMenu("switch.txt");
	naturelist = LoadMPMenu("nature.txt");
	woodlist = LoadMPMenu("wood.txt");
	stonelist = LoadMPMenu("stone.txt");
	fencinglist = LoadMPMenu("fencing.txt");
	decorationslist = LoadMPMenu("decorations.txt");
	plantslist = LoadMPMenu("plants.txt");
	
	
	new blocksam=0, zonesam=0, labelsam=0;


			new idtz[100],ftz[256];
   			new Float:xz, Float:yz, rz;
	for(new i=0;i<MAX_ZONES;i++)
 	{


			format(idtz,sizeof(idtz),"%d",i);

			if(dini_Isset(ZONESFILE,idtz))
			{
	
			ftz=dini_Get(ZONESFILE,idtz);

   			
   			sscanf(ftz, "ffd", xz,yz,rz);

 			SAVED_ZONE[i]=CreateDynamicCircle(xz,yz,rz);
	zonesam++;


 			#if defined PRINT_LOADING_INFO
			 printf("Loading Zones: %d",zonesam);
			 #endif
 			}
 			else
 			{
 			SAVED_ZONE[i]=-1;
			}
 	}
 	
 	#if defined PRINT_LOADING_INFO
	 print("Safe Zones loaded!\n");
	 #endif
	 
	 
	 
	 
	 
			new idtl[100],rtl[1024],ftl[256];
   			new Float:xl, Float:yl, Float: zl;
	for(new i=0;i<MAX_LABELS;i++)
 	{


			format(idtl,sizeof(idtl),"%d",i);

			if(dini_Isset(LABELSFILE,idtl))
			{

			ftl=dini_Get(LABELSFILE,idtl);
   	


   			
   			sscanf(ftl, "fffp<->s[1024]", xl,yl,zl,rtl);

 			SAVED_LABEL[i]=CreateDynamic3DTextLabel(rtl,0xFFFFFFFF, xl,yl,zl,500);
	labelsam++;


 			#if defined PRINT_LOADING_INFO
			 printf("Loading labels: %d",labelsam);
			 #endif
 			}
 			else
 			{
 			SAVED_LABEL[i]=Text3D:-1;
			}
 	}

 	#if defined PRINT_LOADING_INFO
	 print("Labels loaded!\n");
	 #endif




new string[256];
new File:objectsFile = fopen(MAPFILE, io_read);

// check if it is a valid file handle, it might crash the server if it isn't
if(objectsFile)
{
    // it's always better to declare variables outside loops
    new id, seq,Float:x, Float:y, Float:z, r,text[512];

    // we read the file line by line, first line is stored into string and so on..
    while(fread(objectsFile, string))
    {
    blocksam++;
        // we extract the contents of string into variables
        sscanf(string, "p<=>dp<;>dfffI(0)p<=>s[512]", seq,id, x, y, z, r,text);

            SAVED[seq]=CreateBlock(id, x, y, z, r);
            if(id==SIGN_ID) UpdateSignText(SAVED[seq],text);
            #if defined PRINT_LOADING_INFO
                if(blocksam%100==0)printf("Loading blocks: %d",blocksam);
            #endif


    }
    fclose(objectsFile);
}


 
 	#if defined PRINT_LOADING_INFO
	  print("Blocks loaded!\n");
	  #endif
 	
 	


	print("\n----------------------------------");
	print("Ultra Cubic World server loaded");
	printf("With %d blocks, %d safe zones, %d labels\n",blocksam,zonesam, labelsam);
	printf(" -%s aka %s",NICK,FULL_NAME);
	printf(" -%s",COPYRIGHT_DATE);
	printf(" -%s",LOCATION);
	printf(" -Skype: %s",SKYPE);
	print(" -All rights reserved\n");
	print("----------------------------------\n");

	return 1;
}



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;
}

CreateBlock(blockmodel,Float:x, Float:y, Float:z,rot=0)
{
	new ob;
	if(blockmodel<DECORATIONS_ID)
	{
	ob = CreateDynamicObjectEx(CUBE_MODEL[blockmodel],x,y,z, 0,0,0,900,100);
	SetDynamicObjectMaterial(ob, 0, cmodel[blockmodel], ctxd[blockmodel], ctexture[blockmodel], ccolor[blockmodel]);
	BlockX[ob]=x;
	BlockY[ob]=y;
	BlockZ[ob]=z;
	}
	else
	{
	if(DECO_MODEL[blockmodel-DECORATIONS_ID]==DOOR_1 || DECO_MODEL[blockmodel-DECORATIONS_ID]==DOOR_2) return CreateDoor(blockmodel,x,y,z,rot);
	if(DECO_MODEL[blockmodel-DECORATIONS_ID]==SIGN) return CreateSign(blockmodel,x,y,z,rot);
	if(rot==0) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_X_INDEX[blockmodel-DECORATIONS_ID],y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	if(rot==90) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y+DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	
	if(rot==180) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_X_INDEX[blockmodel-DECORATIONS_ID],y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	if(rot==270) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y-DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	BlockX[ob]=x;
	BlockY[ob]=y;
	BlockZ[ob]=z;
	}
	BlockAdd[ob]=-1;
	
	
	return ob;
}

CreateDoor(blockmodel,Float:x,Float:y,Float:z,rot=0)
{
	new ob,dob[4];

	if(rot==0) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_X_INDEX[blockmodel-DECORATIONS_ID],y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	if(rot==90) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y+DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);

	if(rot==180) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_X_INDEX[blockmodel-DECORATIONS_ID],y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	if(rot==270) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y-DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	
	if(rot==0)
	{
	dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_X,y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
	}
	
	if(rot==90)
	{
	dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_Y,y+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
   }
	
	if(rot==180)
	{
	dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_X,y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
	}
	
	if(rot==270)
	{
	dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Y,y-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
  }
	
	BlockX[ob]=x;
	BlockY[ob]=y;
	BlockZ[ob]=z;
	BlockAdd[ob]=dob[0];
	return ob;
}

CreateSign(blockmodel,Float:x,Float:y,Float:z,rot=0)
{
	new ob,dob[4];

	if(rot==0) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_X_INDEX[blockmodel-DECORATIONS_ID],y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	if(rot==90) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y+DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);

	if(rot==180) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_X_INDEX[blockmodel-DECORATIONS_ID],y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
	if(rot==270) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y-DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);

	if(rot==0)
	{
	dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_X,y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
	}

	if(rot==90)
	{
	dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_Y,y+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
 	}

	if(rot==180)
	{
	dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_X,y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
	}

	if(rot==270)
	{
	dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Y,y-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
   	}
   	
   	SetDynamicObjectMaterialText(dob[0],0,"Blank sign",OBJECT_MATERIAL_SIZE_256x128,"Arial",36,1,0xFF000000,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
	BlockX[ob]=x;
	BlockY[ob]=y;
	BlockZ[ob]=z;
	BlockAdd[ob]=dob[0];
	return ob;
}


DestroyBlock(blockid)
{
	DestroyDynamicObject(blockid);
	BlockX[blockid]=0;
	BlockY[blockid]=0;
	BlockZ[blockid]=0;
	DestroyDynamicObject(BlockAdd[blockid]);
	BlockAdd[blockid]=-1;
}

UpdateSignText(blockid,text[]="Blank sign")
{
	new size;
   	if(strlen(text)>0) size=36;
   	if(strlen(text)>15) size=28;
   	if(strlen(text)>20) size=20;
SetDynamicObjectMaterialText(BlockAdd[blockid],0,text,OBJECT_MATERIAL_SIZE_256x128,"Arial",size,1,0xFF000000,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
}

DisableBlock(playerid)
{
			 BlockHold[playerid]=0;

			 BlockID[playerid]=-1;

			 return 1;
}

FindClosestVal(Float:val,Float:toval, &Float:fval)
{
	new a=0;
	new Float:x=0, Float:x2=0;
	new Float: val2=val*100;
	new val3=floatround(val2,floatround_round);
	new val31=val3;

	new Float:val4=toval*100;

	new val5=floatround(val4,floatround_round);

	while (a==0)
	{
		x= val3 % val5;
		x2= val31 % val5;

		if(x==0) a=1;
		if(x2==0) a=2;
		if(x2!=0 && x!=0) a=0,val3=val3+1,val31=val31-1;
	}
	if(a==1) fval=float(val3);
	if(a==2) fval=float(val31);
	fval=fval/100;

	return 1;
}

forward PlayRadio(playerid, response_code, const data[]);
public PlayRadio(playerid, response_code, const data[])
{

    if(response_code == 200) 
    {
     
        PlayAudioStreamForPlayer(playerid,"http://ultrabee.dlinkddns.com:7775/live");
        SendClientMessage(playerid, 0xFFFFFFFF,"{00ff00}Our radio is online! You started to listen to it!");
    }
    else
    {
        
        SendClientMessage(playerid, 0xFFFFFFFF,"{ff0000}Our radio is offline! {00ff00}We are sorry :(");
    }
}

GetXYInFrontOfPlayer(playerid, &Float:XP, &Float:YP, &Float:ZP, Float:distance)
{
 		new
			Float:fPX, Float:fPY, Float:fPZ,
			Float:fVX, Float:fVY, Float:fVZ;

	
		GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
		GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
	 
		ZP = fPZ + floatmul(fVZ, distance);
		XP = fPX + floatmul(fVX, distance);
		YP = fPY + floatmul(fVY, distance);

		if(ZP<CUBE_SIZE_HEIGH*KOEF)
		{
			new Float: k = (CUBE_SIZE_HEIGH*KOEF)/ZP;
		 	ZP=CUBE_SIZE_HEIGH*KOEF;
		 	if(k>=0)
		 	{
		 	XP = fPX + floatmul(fVX, distance)/k;
		 	YP = fPY + floatmul(fVY, distance)/k;
		 	}
		 	if(k<0)
		 	{
		 	XP = fPX + floatmul(fVX, distance)/(-k);
		 	YP = fPY + floatmul(fVY, distance)/(-k);
		 	}
	 	}


}

stock abs( value )
{
   return ( ( value < 0 ) ? ( -value ) : ( value ) );
}
stock GetName(playerid)
{
    new
    name[24];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        
	if(PRESSED(BUTTON_SWITCH))
	{
		CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
    new act=GetPlayerSpecialAction(playerid);
		ClearAnimations(playerid);
		SetPlayerSpecialAction(playerid,act);
	}
	


	
	if(PRESSED(BUTTON_DISABLE))
	{
	    if(BlockHold[playerid]==1)
	    {
		DisableBlock(playerid);
	PlayerPlaySound(playerid, 1138, 0.0, 0.0, 0.0);
	RotDec[playerid]=0;
		}
	}
	
	if(PRESSED(BUTTON_PUT))
	{
	    if(BlockHold[playerid]==1)
	    {
	    if(PutFlood[playerid]==1) return 1;
	    	if(IsPlayerInRangeOfPoint(playerid, 10.0, BASE_PLACE_X, BASE_PLACE_Y, BASE_PLACE_Z)) return Warn(playerid,"{ff0000}You can't build so close to spawn");
	    PlayerPlaySound(playerid,6400,0,0,0);
		SetTimerEx("PutBlockFromPlayer",400,0,"d",playerid);
		SetPlayerTimer("ClearPutFlood",PUT_FLOOD_SECONDS,0);
		PutFlood[playerid]=1;

		}
	}
	
	if(PRESSED(BUTTON_DESTROY))
	{
		if(DesFlood[playerid]==1) return 1;
	    PlayerPlaySound(playerid,6400,0,0,0);
		SetTimerEx("DestroyBlockFromPlayer",400,0,"d",playerid);
		SetPlayerTimer("ClearDesFlood",DES_FLOOD_SECONDS,0);
		DesFlood[playerid]=1;
	}

	if(PRESSED(BUTTON_ROTATE))
	{
	    
	    if(BlockID[playerid]<DECORATIONS_ID) return Warn(playerid,"{ff0000}You haven't choosen the decoration!");
	    PlayerPlaySound(playerid,4202,0,0,0);
  		RotDec[playerid]=RotDec[playerid]+90;
  		if(RotDec[playerid]>=360) RotDec[playerid]=0;
  		format(stringu,sizeof(stringu),"{00ff00}You have changed the decoration rotation to %d",RotDec[playerid]);
 		SendClientMessage(playerid, 0xFFFFFFFF,stringu);

	}
	return 1;
}

public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
	switch(dialogid)
	{
	    case DIALOGID+REG_DIALOG:
	    {
	        if(response)
	        {
				if(strlen(inputtext)<=0 || strlen(inputtext)>32) return SPD(playerid, DIALOGID+REG_DIALOG, DIALOG_STYLE_PASSWORD, "MWF-Register", "{ff0000}ERROR: Your Password Must Have A Atleast 4 -> 32 Charaters", "..::Ok::..", "");
				Register(playerid,inputtext);
	        }
	        if(!response) return SPD(playerid, DIALOGID+REG_DIALOG, DIALOG_STYLE_PASSWORD, "MWF-Register", "{ff0000}Hello, You Need To Register To Play MineCraft World Of Fun", "..::Ok::..", "");
	    }
	    case DIALOGID+LOG_DIALOG:
	    {
	        if(response)
	        {
				if(!IsPasswordMatch(playerid,inputtext)) return SPD(playerid, DIALOGID+LOG_DIALOG, DIALOG_STYLE_PASSWORD, "MWF-Login", "{ff0000}You Have Typed A Wrong Passwrod,Try Again", "..::Ok::..", "");
				Login(playerid);
	        }
	        if(!response) return SPD(playerid, DIALOGID+LOG_DIALOG, DIALOG_STYLE_PASSWORD, "MWF-Login", "{ff0000}ERROR: You Need To Login Or Else you can't Spawn", "..::Ok::..", "");
	    }
	    case DIALOGID+1:
	    {
	        if(response)
	        {
				if(strlen(inputtext)<=0) return SPD(playerid,DIALOGID+1,DIALOG_STYLE_INPUT,"Sign","{ff0000}You Din't Preass Anything!","..::Ok::..","..::No::..");
				UpdateSignText(LastBlock[playerid][0],inputtext);
				new idt[100],ft[256];
				format(idt,sizeof(idt),"%d",LastBlock[playerid][1]);
				ft=dini_Get(MAPFILE,idt);
				format(ft,sizeof(ft),"%s %s",ft,inputtext);
				dini_Set(MAPFILE,idt,ft);
	        }
	        else
	        {
				UpdateSignText(LastBlock[playerid][0],"Blank sign");
				new idt[100],ft[256];
				format(idt,sizeof(idt),"%d",LastBlock[playerid][1]);
				ft=dini_Get(MAPFILE,idt);
				format(ft,sizeof(ft),"%s Blank sign",ft);
				dini_Set(MAPFILE,idt,ft);
	        }
	    }
	}
	return 1;
}
public OnPlayerEnterDynamicArea(playerid,areaid)
{
	if(areaid==Zone[playerid][0]) Inform(playerid,"{00ff00}You have just entered your own safe zone!");
	else Inform(playerid,"{ffff00}You have just entered someone's safe zone!");
	return 1;
}

forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid,1);
PlayerPlaySound(playerid,1137 ,0.0,0.0,0.0);
GameTextForPlayer(playerid, "~b~Done!", 2000, 3);
CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
}

IsThereAnyBlock(Float:x,Float:y,Float:z)
{
				new a=0;
				for(new i=0;i<MAX_BLOCKS;i++)
			 	{
				 			if(BlockX[i]==x && BlockY[i]==y && BlockZ[i]==z) a=1;
				 			
				}
				return a;
}

public OnMPMenuResponse(playerid, response, listid, modelid,listitem)
{
 
    if(listid == switchlist)
    {
        if(response)
        {
		 if(listitem == 0) return ShowMPMenu(playerid, naturelist, "~y~Switch blocks",nnames,8,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 1) return ShowMPMenu(playerid, woodlist, "~y~Switch blocks",wnames,7,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 2) return ShowMPMenu(playerid, stonelist, "~y~Switch blocks",snames,7,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 3) return ShowColorMPMenu(playerid, colcolors, 9, "~y~Switch blocks", colorlist, colnames,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 4) return ShowColorMPMenu(playerid, gcolors, 9, "~y~Switch blocks", glasslist, gnames,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 5) return ShowMPMenu(playerid, fencinglist, "~y~Switch blocks",fnames,3,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 6) return ShowMPMenu(playerid, decorationslist, "~y~Switch blocks",dnames,15,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
		 if(listitem == 7) return ShowMPMenu(playerid, plantslist, "~y~Switch blocks",pnames,12,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);

		 if(listitem == 8)
		 {
			DisableBlock(playerid);
		 }

        }
   }
   
   if(listid == naturelist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=0;
			}
            if(listitem==1)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=1;
			}
            if(listitem==2)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=2;
			}
            if(listitem==3)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	       
			BlockHold[playerid]=1;
			BlockID[playerid]=3;
			}
            if(listitem==4)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=4;
			}
            if(listitem==5)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=5;
			}
            if(listitem==6)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=6;
			}
            if(listitem==7)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=17;
			}

	        
        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
   
   if(listid == woodlist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=7;
			}
            if(listitem==1)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	  
			BlockHold[playerid]=1;
			BlockID[playerid]=8;
			}
            if(listitem==2)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=9;
			}
			
			
            if(listitem==3)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=18;
			}
            if(listitem==4)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=19;
			}
            if(listitem==5)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	    
			BlockHold[playerid]=1;
			BlockID[playerid]=20;
			}
            if(listitem==6)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	       
			BlockHold[playerid]=1;
			BlockID[playerid]=21;
			}


        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
   if(listid == stonelist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=10;
			}
            if(listitem==1)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=11;
			}
            if(listitem==2)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	     
			BlockHold[playerid]=1;
			BlockID[playerid]=12;
			}
            if(listitem==3)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=13;
			}
            if(listitem==4)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=14;
			}
            if(listitem==5)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	       
			BlockHold[playerid]=1;
			BlockID[playerid]=15;
			}
            if(listitem==6)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=16;
			}


        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }


    if(listid == fencinglist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=39;
			}
            if(listitem==1)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=40;
			}
            if(listitem==2)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=41;
			}




        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
    if(listid == decorationslist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+0;
			}
            if(listitem==1)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+1;
			}
            if(listitem==2)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+2;
			}
            if(listitem==3)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+3;
			}
            if(listitem==4)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+4;
			}
            if(listitem==5)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+5;
			}
            if(listitem==6)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+6;
			}
            if(listitem==7)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+7;
			}
            if(listitem==8)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+8;
			}
            if(listitem==9)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+9;
			}
            if(listitem==10)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+10;
			}
            if(listitem==11)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+11;
			}
            if(listitem==12)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+12;
			}
            if(listitem==13)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+13;
			}
            if(listitem==14)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+14;
			}


        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
    if(listid == plantslist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+15;
			}
            if(listitem==1)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+16;
			}
            if(listitem==2)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+17;
			}
            if(listitem==3)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+18;
			}
            if(listitem==4)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+19;
			}
            if(listitem==5)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+20;
			}
            if(listitem==6)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+21;
			}
            if(listitem==7)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+22;
			}
            if(listitem==8)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+23;
			}
            if(listitem==9)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+24;
			}
            if(listitem==10)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+25;
			}
            if(listitem==11)
            {
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);

			BlockHold[playerid]=1;
			BlockID[playerid]=DECORATIONS_ID+26;
			}

        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
    return 1;
}
public OnDynamicMPMenuResponse(playerid, response, extraid, modelid, listitem)
{
   if(extraid == colorlist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=22;
			}
            if(listitem==1)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=23;
			}
            if(listitem==2)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=24;
			}
            if(listitem==3)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=25;
			}
            if(listitem==4)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=26;
			}
            if(listitem==5)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=27;
			}
            if(listitem==6)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=28;
			}
            if(listitem==7)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	    
			BlockHold[playerid]=1;
			BlockID[playerid]=29;
			}
            if(listitem==8)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);

			BlockHold[playerid]=1;
			BlockID[playerid]=30;
			}


        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
    if(extraid == glasslist)
    {
        if(response)
        {
        	PlayerPlaySound(playerid,1150,0,0,0);
            if(listitem==0)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	      
			BlockHold[playerid]=1;
			BlockID[playerid]=31;
			}
            if(listitem==1)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=32;
			}
            if(listitem==2)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	       
			BlockHold[playerid]=1;
			BlockID[playerid]=33;
			}
            if(listitem==3)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=34;
			}
            if(listitem==4)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	  
			BlockHold[playerid]=1;
			BlockID[playerid]=35;
			}
            if(listitem==5)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	       
			BlockHold[playerid]=1;
			BlockID[playerid]=36;
			}
            if(listitem==6)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	        
			BlockHold[playerid]=1;
			BlockID[playerid]=37;
			}
            if(listitem==7)
            {
	        new Float:x, Float:y,Float:z;
		 	if(BlockHold[playerid]==1) DisableBlock(playerid);
	        GetPlayerPos(playerid,x,y,z);
	        GetXYInFrontOfPlayer(playerid, x, y,z, SCALE);
	       
			BlockHold[playerid]=1;
			BlockID[playerid]=38;
			}



        }
        else
        {
        CallLocalFunction( "OnPlayerCommandText", "ds", playerid,"/switch");
        }
   }
	return 1;
}

forward UpdateCubes(i);
public UpdateCubes(i)
{
if(BlockID[i] != -1)
{
 	if(BlockID[i]<DECORATIONS_ID) format(stringu, sizeof(stringu), "~w~Selected block:~n~~p~~h~~h~%s",CUBE_NAME[BlockID[i]]);
 	else format(stringu, sizeof(stringu), "~w~Selected decoration:~n~~p~~h~~h~%s",DECO_NAME[BlockID[i]-DECORATIONS_ID]);
}
else format(stringu, sizeof(stringu), "~w~Selected block:~n~~p~~h~~h~None");
PlayerTextDrawSetString(i,BLOCKINFO[i],stringu);
    return 1;
}
	
	forward DestroyEffect(e);
	public DestroyEffect(e)
	{
	DestroyDynamicObject(e);
	return 1;
	}

forward ClearPutFlood(playerid);
public ClearPutFlood(playerid)
{
 PutFlood[playerid]=0;
}

forward ClearDesFlood(playerid);
public ClearDesFlood(playerid)
{
 DesFlood[playerid]=0;
}
forward PutBlockFromPlayer(playerid);
public PutBlockFromPlayer(playerid)
{
	    
     		new Float:x, Float:y,Float:z;
     		new Float:x2, Float:y2, Float:z2;
     		new Float:x3, Float:y3, Float:z3;
     		new blockidx;
			new ft[256],idt[100];
	        GetPlayerPos(playerid,x,y,z);

	        new SCALENEW=MIN_SCALE;
			new sc=0;
			while(sc==0)
			{
			        GetXYInFrontOfPlayer(playerid, x, y,z, SCALENEW);
			        FindClosestVal(x,CUBE_SIZE_WIDE,x2);
			        FindClosestVal(y,CUBE_SIZE_WIDE,y2);
			        FindClosestVal(z,CUBE_SIZE_HEIGH,z2);
					if(!IsThereAnyBlock(x2,y2,z2)) x3=x2,y3=y2,z3=z2,sc=0,SCALENEW++;
					if(IsThereAnyBlock(x2,y2,z2) || SCALENEW>=SCALE) sc=1;
			}
			if(x3==0 && y3==0 && z3==0) return 1;
   			if(IsPlayerInRangeOfPoint(playerid, 1.0, x3, y3, z3)) return PlayerPlaySound(playerid,1150,0,0,0);
			if(IsPointInAnyDynamicArea(x3,y3,z3))
	        {
	        if(!IsPointInDynamicArea(Zone[playerid][0], x3,y3,z3)) return Warn(playerid,"{ff0000}This area is protected by /safe! You can't build here!");
	        }


			PlayerPlaySound(playerid,1135,0,0,0);

			new d=0;
			new idrd=0;
			while (d==0)
			{
				idrd++;

    			if(SAVED[idrd]!=0) d=0;
    			else d=1, blockidx=idrd;
			}
			format(idt,sizeof(idt),"%d",blockidx);
			format(ft,sizeof(ft),"%d %f %f %f %d",BlockID[playerid],x3,y3,z3,RotDec[playerid]);
			dini_Set(MAPFILE,idt,ft);



 			if(BlockID[playerid]<DECORATIONS_ID) SAVED[blockidx]=CreateBlock(BlockID[playerid], x3,y3,z3);
 			else SAVED[blockidx]=CreateBlock(BlockID[playerid], x3,y3,z3,RotDec[playerid]);
 			
	LastBlock[playerid][0]=SAVED[blockidx];
	LastBlock[playerid][1]=blockidx;

			if(BlockID[playerid]==SIGN_ID)
			{
			SPD(playerid,DIALOGID+1,DIALOG_STYLE_INPUT,"Sign","{00ff00}Type a text for a sign here","..::Ok::..","..::No::..");
			}

			Streamer_Update(playerid);
			RotDec[playerid]=0;
			return 1;

}

forward DestroyBlockFromPlayer(playerid);
public DestroyBlockFromPlayer(playerid)
{
     		new Float:x, Float:y,Float:z;
     		new Float:x2, Float:y2, Float: z2;
	        GetPlayerPos(playerid,x,y,z);
	        for(new SCALENEW=MIN_SCALE_DES;SCALENEW<SCALE;SCALENEW++)
	        {
		        GetXYInFrontOfPlayer(playerid, x, y, z, SCALENEW);
		        FindClosestVal(x,CUBE_SIZE_WIDE,x2);
		        FindClosestVal(y,CUBE_SIZE_WIDE,y2);
		        FindClosestVal(z,CUBE_SIZE_HEIGH,z2);
			if(IsPointInAnyDynamicArea(x2,y2,z2))
	        {
	        if(!IsPointInDynamicArea(Zone[playerid][0], x2,y2,z2)) return Warn(playerid,"{ff0000}This area is protected by /safe! You can't build here!");
	        }
				for(new i=0;i<MAX_BLOCKS;i++)
			 	{
				 			if(BlockX[i]==x2 && BlockY[i]==y2 && z2==BlockZ[i])
				 			{
			   					DestroyBlock(i);
			   					CreateExplosion(x2, y2, z2, 12, 5.0);
							    new bid;
							    new r=0,rd=0;
				                while(r == 0)
				                {
					                if(SAVED[rd]==i)  bid=rd,r=1;
					                else rd++,r=0;
				                }
								new idt[100];
		                        format(idt,sizeof(idt),"%d",bid);

								SAVED[bid]=0;
								dini_Unset(MAPFILE,idt);
								
								return 1;
								
				 			}

			 	}

			}
			return 1;
}


Register(playerid,password[])
{
    PlayerPlaySound(playerid,1185,0,0,0);
	new file[256];
	new year,day,month,ip[256],pass[512];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file,sizeof(file),USERFILE,pname);
  dini_Create(file);
  getdate(year,month,day);
  format(stringu,sizeof(stringu),"%d/%d/%d",day,month,year);
  dini_Set(file,"REGISTRATION_DATE",stringu);
  GetPlayerIp(playerid,ip,sizeof(ip));
  dini_Set(file,"IP",ip);
  pass=HashPass(password);
  dini_Set(file,"PASSWORD",pass);
  SendClientMessage(playerid, 0xFFFFFFFF,"{ffffff}You have successfully registered! {00ff00}Enjoy the game!");
  Login(playerid);
  
}
Login(playerid)
{
    PlayerPlaySound(playerid,1185,0,0,0);
	new file[256];
	new ip[256];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file,sizeof(file),USERFILE,pname);
  GetPlayerIp(playerid,ip,sizeof(ip));
  dini_Set(file,"IP",ip);
  if(dini_Isset(file,"SAFE_ZONE")) Zone[playerid][1]=dini_Int(file,"SAFE_ZONE"),Zone[playerid][0]=SAVED_ZONE[Zone[playerid][1]];
  if(dini_Isset(file,"SAFE_LABEL")) Label_ID[playerid]=dini_Int(file,"SAFE_LABEL"),Label[playerid]=SAVED_LABEL[Label_ID[playerid]];
  SendClientMessage(playerid, 0xFFFFFFFF,"{ffffff}You have successfully logged in!");
}
IsPlayerRegistered(playerid)
{
	new file[256];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file,sizeof(file),USERFILE,pname);
  if(dini_Exists(file)) return 1;
  else return 0;
}
IsIpMatch(playerid)
{
	new file[256];
	new ip[256];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file,sizeof(file),USERFILE,pname);
  GetPlayerIp(playerid,ip,sizeof(ip));
  if(!strcmp(ip, dini_Get(file,"IP"), true)) return 1;
  else return 0;
}
IsPasswordMatch(playerid,password[])
{
	new file[256];
	new pass[512];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file,sizeof(file),USERFILE,pname);

  pass=HashPass(password);
  if(!strcmp(pass,dini_Get(file,"PASSWORD"))) return 1;
  else return 0;
}
Warn(playerid,text[])
{
SendClientMessage(playerid,0xFF0000,text);
PlayerPlaySound(playerid,1150,0,0,0);
return 1;
}
Inform(playerid,text[])
{
SendClientMessage(playerid,0xFF0000,text);
PlayerPlaySound(playerid,1058,0,0,0);
return 1;
}

stock HashPass(text[])
{
    new buf[129];
    WP_Hash(buf, sizeof (buf), text);
    return buf;
}

stock IsNumeric(line[]){
  for(new i=0, j=strlen(line); i<j; i++){
    if(line[i]>'9' || line[i]<'0') return 0;}
  return 1;}
  
  CMD:help(playerid, params[])  return cmd_about(playerid, params);
CMD:about(playerid, params[])
{
	new dialogbox[1024];
	strcat(dialogbox,"{ffcc00}Hello, dear player! We are happy to see you here! \nIt is a place where you can show everybody your imagination and creativity! \n");
	strcat(dialogbox,"{00ff00}Create magnificent masterworks from cubes, or just build something more simple - the choice is yours!\n");
	format(stringu, sizeof(stringu), "{ff00ff}To switch blocks, press button {ff0000}%s. \n{ff00ff}To put the block, press {ff0000}%s, {ff00ff} to destroy it, press {ff0000}%s. \n{ff00ff}To change the decoration rotation press {ff0000}%s.\n{ff00ff}To disable block selection press {ff0000}%s\n",BUTTON_SWITCH_T,BUTTON_PUT_T, BUTTON_DESTROY_T,BUTTON_ROTATE_T,BUTTON_DISABLE_T);
	strcat(dialogbox,stringu);
	format(stringu, sizeof(stringu), "{00ffff}That's all! Good luck and enjoy your game! If you need commands list, check /cmd.\n\n{ff00ff}Project is in development. Since 7 March 2013\nScripter and owner: %s aka %s\nSkype: %s\n\n",NICK,FULL_NAME,SKYPE);
	strcat(dialogbox,stringu);
	format(stringu,sizeof(stringu),"{ffff00}Special thanks for help and testing:\n{00ff00}%s\n\n{ffff00}And, ofcourse, many thanks to theese people for their tools and plugins:\n{ff0000}%s",CREDITS,CREDITS_2);
	strcat(dialogbox,stringu);
	SPD(playerid, DIALOGID+1000, DIALOG_STYLE_MSGBOX, "MWF-Express your creativity", dialogbox, "..::Ok::..", "");
	return 1;
}


CMD:cmd(playerid, params[])  return cmd_cmds(playerid, params);
CMD:c(playerid, params[])  return cmd_cmds(playerid, params);
CMD:command(playerid, params[])  return cmd_cmds(playerid, params);
CMD:commands(playerid, params[])  return cmd_cmds(playerid, params);
CMD:cmds(playerid, params[])
{
	new dialogbox[1024];
	strcat(dialogbox,"{ff00ff}Server commands list:\n\n");
	strcat(dialogbox,"{ffff00}/spawn - go to spawn place\n");
	strcat(dialogbox,"{ffff00}/fly - get jetpack to fly\n{ffff00}/safe [distance] - to set a safe zone at your place\n\n{ffff00}/delsafe - to delete your safe zone\n");
	strcat(dialogbox,"{ffff00}/label [text] - to set a label at your place\n{ffff00}/dellabel - to delete your label\n");
	SPD(playerid, DIALOGID+1000, DIALOG_STYLE_LIST, "MWF-xpress your creativity", dialogbox, "..::Ok::..", "");
	return 1;
}

CMD:switch(playerid, params[])
{
	ShowMPMenu(playerid, switchlist, "Switch blocks",cnames,9,   0xc8c6bf44,  0xDBC77E77 ,   0xF4B81BAA);
	return 1;
}
CMD:spawn(playerid, params[])
{
	SetPlayerPos(playerid,BASE_PLACE_X, BASE_PLACE_Y, BASE_PLACE_Z+2);
	Inform(playerid,"{00ff00}You have been successfully teleported to spawn!");
	return 1;
}
CMD:jet(playerid, params[])  return cmd_fly(playerid, params);
CMD:jp(playerid, params[])  return cmd_fly(playerid, params);
CMD:jetpack(playerid, params[])  return cmd_fly(playerid, params);
CMD:fly(playerid, params[])
{
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
	return 1;
}
CMD:safe(playerid, params[])
{
	new safezone;
	if(safezone < 0 || safezone > 15) return Warn(playerid,"{ff0000}USAGE: /safe [radius:1-15]");
	if(IsPlayerInAnyDynamicArea(playerid)) return Warn(playerid,"{ff0000}You are in another safe area! Come to another place!");
	new Float:x,Float:y,Float:z;
	new ft[256];
	new tt[100];
	GetPlayerPos(playerid,x,y,z);

	if(IsValidDynamicArea(Zone[playerid][0]))
	{
		DestroyDynamicArea(Zone[playerid][0]);
		format(tt,sizeof(tt),"%d",Zone[playerid][1]);
		dini_Unset(ZONESFILE,tt);

		SAVED_ZONE[Zone[playerid][1]]=-1;
		Zone[playerid][1]=-1;
		Zone[playerid][0]=-1;
	}
	Zone[playerid][0]=CreateDynamicCircle(x,y,safezone);

	new d=0;
	new idrd=0;
	new zoneidx;
	while (d==0)
	{
		idrd++;

		if(SAVED_ZONE[idrd]!=-1) d=0;
		else d=1, zoneidx=idrd;
	}
	format(tt,sizeof(tt),"%d",zoneidx);
	Zone[playerid][1]=zoneidx;
	SAVED_ZONE[zoneidx]=Zone[playerid][0];
	format(ft,sizeof(ft),"%f %f %d",x,y,safezone);
	dini_Set(ZONESFILE,tt,ft);

	new file[256];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(file,sizeof(file),USERFILE,pname);
	dini_IntSet(file,"SAFE_ZONE",zoneidx);

	Inform(playerid,"You have just created a safe zone at this place! Only can build here now!");
	return 1;
}

CMD:delsafe(playerid, params[])
{
	new tt[100];
	if(IsValidDynamicArea(Zone[playerid][0]))
	{
		DestroyDynamicArea(Zone[playerid][0]);
		format(tt,sizeof(tt),"%d",Zone[playerid][1]);
		dini_Unset(ZONESFILE,tt);

		SAVED_ZONE[Zone[playerid][1]]=-1;
		Zone[playerid][1]=-1;
		Zone[playerid][0]=-1;
		Inform(playerid,"{00ff00}You have just deleted your safe zone!");
	}
	else
	{
		Warn(playerid,"{ff0000}You don't have any safe zone created!");
	}
	return 1;
}

CMD:label(playerid, params[])
{
    new tmp[1024];
    if(sscanf(params, "s[1024]", tmp)) return SendClientMessage(playerid,-1,"{ff0000}/label [text] [text from 1 to 50 characters]");
    new Float:x,Float:y,Float:z;
    new ft[256];
    new tt[100];
    GetPlayerPos(playerid,x,y,z);

    if(IsValidDynamic3DTextLabel(Label[playerid]))
    {
        DestroyDynamic3DTextLabel(Label[playerid]);
        format(tt,sizeof(tt),"%d",Label_ID[playerid]);
        dini_Unset(LABELSFILE,tt);

        SAVED_LABEL[Label_ID[playerid]]=Text3D:-1;
        Label_ID[playerid]=-1;
        Label[playerid]=Text3D:-1;
    }
    Label[playerid]=CreateDynamic3DTextLabel(tmp,0xFFFFFFFF, x,y,z,500);

    new d=0;
    new idrd=0;
    new zoneidx;
    while (d==0)
    {
        idrd++;

        if(SAVED_LABEL[idrd]!=Text3D:-1) d=0;
        else d=1, zoneidx=idrd;
    }
    format(tt,sizeof(tt),"%d",zoneidx);
    Label_ID[playerid]=zoneidx;
    SAVED_LABEL[zoneidx]=Label[playerid];
    format(ft,sizeof(ft),"%f %f %f %s",x,y,z,tmp);
    dini_Set(LABELSFILE,tt,ft);

    new file[256];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file,sizeof(file),USERFILE,pname);
    dini_IntSet(file,"SAFE_LABEL",zoneidx);

    Inform(playerid,"{00ff00}You have just created a text label at this place!");
    return 1;
}

CMD:dellabel(playerid, params[])
{

	new tt[100];

	if(IsValidDynamic3DTextLabel(Label[playerid]))
	{
		DestroyDynamic3DTextLabel(Label[playerid]);
		format(tt,sizeof(tt),"%d",Label_ID[playerid]);
		dini_Unset(LABELSFILE,tt);

		SAVED_LABEL[Label_ID[playerid]]=Text3D:-1;
		Label_ID[playerid]=-1;
		Label[playerid]=Text3D:-1;
		Inform(playerid,"{00ff00}You have just deleted your text label!");
	}
	else
	{
		Warn(playerid,"{ff0000}You don't have any label created!");
	}

	return 1;
}
Reply

Quote:
Originally Posted by TDM
Посмотреть сообщение
Looking for :-

~Forum Developers
~Website Makers
~Administrators
~Scripters
~Mappers


Server Information : 2 servers (Racing and CnR/DM)
Hosted tab.
Professional domain.
200 slots each server.


Note* : If you are interested in any of the above positions please pm me with your skype ID!
Looking for :-

~Forum Developers
~Website Makers
~Administrators
~Scripters
~Mappers


Server Information : 2 servers (Racing and CnR/DM)
Hosted tab.
Professional domain.
200 slots each server.


Note* : If you are interested in any of the above positions please pm me with your skype ID!
Reply

Searching for BETA-Testers and mappers for a custom TDM gamemode.
Skype: LocMax
Reply

Hey guys,

I am searching experienced scripter who can help me on fixing some small issues. I am willing to pay him a fair price. I don't need scammers/haters for this work.

Send me forum PM if you interested

Thanks.
Reply

I'm looking for Los Santos Role Play gamemode and also i'll paying money for it.

I want to start it in china as LS-RP.cn

@HK Hi, can you sell it for me?

If you have good one, please add me Skype: mav1s100 and let me take a test
Reply

Scripting/Mapping or seting up a website/forum for your server for only 1rep xD
Reply

Any one that can host my server i need it quick please
Reply

Hey guys.
Looking for mappers for my DM server, please contact me via PM if you're interested.

Regards
Zues
Reply

Hi I'm looking for game mode that has only a login and register system some player commands and admin commads
Reply

Quote:
Originally Posted by NenzorRoller
View Post
Scripting/Mapping or seting up a website/forum for your server for only 1rep xD
Lol really?Just for a rep...
Reply

Looking for Video Creators & GFX Designer (willing to pay)
Reply

Looking for someone who could pay bills of my server for this month, he will be rewarded with highest level.
Reply

Quote:
Originally Posted by Randomizer123
View Post
Looking for Video Creators & GFX Designer (willing to pay)
I'm a GFX Designer, I can help you
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)