#include <a_samp>
#include <a_http>
#include <streamer>
#include <dini>
#include <MPM>
#include <sscanf2>
#pragma tabsize 0
#define MAX_BLOCKS 16000//Max amount of blocks on the ser
#define DECORATIONS_ID 2000
#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
#pragma unused ret_memcpy
#define MAPFILE "GLOBAL_MAP.sav"//File of saved map
new blocksam=0;
new SAVED[MAX_BLOCKS];
new BlockAdd[MAX_BLOCKS];
new Float:BlockX[MAX_BLOCKS];
new Float:BlockY[MAX_BLOCKS];
new Float:BlockZ[MAX_BLOCKS];
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 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
};
main()
{
print("\n----------------------------------");
print(" This is a blank GameModeScript");
print("----------------------------------\n");
//printf("GetVehicleComponentType %u",GetVehicleComponentType(1100));
}
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;
}
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;
}
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;
}
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);
}
public OnGameModeInit()
{
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);
}
return 1;
}
lol i was Also there ! i wanted to ask you to release the GM , bcz it was awesome ! but there you are
And what Admins Rank's ?! and how i can make my self admin ?! i tried doing that by Scriptfiles > users but i cant open the user .. |
Hey, I have a problem, when I compile gamemode it says 1 error:
Код:
C:\Program Files (x86)\Rockstar Games\SAMP ultra cubic world 2\gamemodes\UCW.pwn(14) : fatal error 100: cannot read from file: "MPM" Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |