Hali.
Ezt a szkriptet még a Homokozóhoz készítettem, de sokat nem használtuk. Hivatalos fórumra már vagy egy hónapja kiraktam.
Licensz: módosíthatod, szabadon oszthatod, stb... DE: tilos sajátodként feltûntetni
Hogy használd?Parancsa: /plot [HOSSZ] [sZÉLESSÉG] [KAPU]
KAPU:
-0: nincs
-1: hátsó kapu
-2: elsõ kapu
Tudsz létrehozni X*x méretû kerítést, kapuval. Gangzonet is kreál a területen.
Minimum: 1*1
Maximum: Végtelen ( azthiszem )
Letöltés: PASTEBINvagy
/*
Plot create scipt
Author: Zharko
Location: Hungary
License: you can editing, sharing to others, etc. BUT: indicate the original author\'s name
*/
#include a_samp
#include core
#include float
#include streamer
#include zcmd
#include sscanf2
#include dini
CMD:plot(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new h, sz, g;
if(sscanf(params, \"ddd\", h, sz, g)) return SendClientMessage(playerid, -1, \"USE: /plot [Length] [Width] [Gate]\");
CreateTelek(playerid, h, sz, g);
return 1;
}
#define PLOTFILE1 \"telkek.ini\"
#define MAX_PLOTS 100
#define ELKERITESOBJ 1446
enum PlotInfos
{
Float:x,
Float:x2,
Float:y,
Float:y2,
Float:z,
Float:z2,
owner[MAX_PLAYER_NAME],
Text3D:ownertext,
haveaccess[256],
area
}
new Plots[MAX_PLOTS][PlotInfos], plotshave, str[128], name2[MAX_PLAYERS][MAX_PLAYER_NAME], objects;
#define formatstr(%1,%2) format(str, sizeof(str), %1, %2)
pName(playerid) { new n[32]; GetPlayerName(playerid, n, sizeof n); return n; }
new zone[MAX_PLAYERS];
//GangZoneDestroy(zone[playerid]);
stock CreateTelek(playerid, HOSSZ, SZELESSEG, gate = 0)
{
#define PLUS_VAL 4.65
#define Z_DIFF 0.5
new
Float: sarok[2],
Float: X, Float: Y, Float: Z, Float: A,
Float: zx[2], Float: zy[2],
Float: counter = X + (PLUS_VAL / 2)
;
GetPlayerPos(playerid, X, Y, Z);
Z = Z-0.5;
zx[ 0 ] = X; zy[ 0 ] = Y;
GetPlayerFacingAngle(playerid, A);
if((270+20) > A > (270-20))
{
counter = X + (PLUS_VAL / 2);
for(new i = 0; i < HOSSZ; ++i) //X
{
if(i == 0) sarok[0] = counter;
if(i == HOSSZ-1) sarok[1] = counter;
CreateDynamicObject(1446, counter, Y, Z, 0.00, 0.00,0.0);
CreateDynamicObject(1446, counter, (Y+(PLUS_VAL*SZELESSEG)), Z, 0.00, 0.0, 180.0);
counter = counter + PLUS_VAL;
}
counter = Y;
for(new i = 0; i < SZELESSEG; ++i) //Y
{
if(i == 0)
{
CreateDynamicObject(1446, (sarok[0]-(PLUS_VAL))+(PLUS_VAL/2), (Y+(PLUS_VAL / 2)), Z, 0.00, 0.0, 270.0); //y1
CreateDynamicObject(1446, sarok[1]+(PLUS_VAL / 2), (counter-(PLUS_VAL))+(PLUS_VAL/2)+PLUS_VAL, Z, 0.00,0.0, 90.0); //y2
}
else if(i == SZELESSEG-1)
{
zx[ 1 ] = sarok[1] + (PLUS_VAL/2); zy[ 1 ] = counter+(PLUS_VAL);
zone[playerid] = GangZoneCreate(zx[0], zy[0], zx[1], zy[1]);
GangZoneShowForPlayer(playerid, zone[playerid],0xFFFF0096);
Plots[area] = CreateDynamicRectangle(zx[0], zy[0], zx[1], zy[1]);
if(gate == 1) CreateDynamicObject(1446, sarok[0]-(PLUS_VAL/2), counter+(PLUS_VAL/2), Z, 0.00, 0.0, 270.0); //y1
else if(gate == 2) CreateDynamicObject(1446, sarok[1]+(PLUS_VAL/2), counter+(PLUS_VAL/2), Z, 0.00, 0.0,90.0); //y2
else
{
CreateDynamicObject(1446, sarok[0]-(PLUS_VAL/2), counter+(PLUS_VAL/2), Z, 0.00, 0.0, 270.0); //y1
CreateDynamicObject(1446, sarok[1]+(PLUS_VAL/2), counter+(PLUS_VAL/2), Z, 0.00, 0.0,90.0); //y2
}
}
else
{
CreateDynamicObject(1446, sarok[0]-(PLUS_VAL/2), counter+(PLUS_VAL/2), Z, 0.00, 0.0, 270.0); //y1
CreateDynamicObject(1446, sarok[1]+(PLUS_VAL/2), counter+(PLUS_VAL/2), Z, 0.00, 0.0,90.0); //y2
}
counter = counter + PLUS_VAL;
}
SendClientMessage(playerid, -1, \"Lekreálva270\");
}
else if((90+20) > A > (90-20))
{
counter = X - (PLUS_VAL / 2);
for(new i = 0; i < HOSSZ; ++i) //X
{
if(i == 0) sarok[0] = counter;
if(i == HOSSZ-1) sarok[1] = counter;
CreateDynamicObject(1446, counter, Y, Z, 0.00, 0.00,180);
CreateDynamicObject(1446, counter, Y, Z, 0.00, 0.00,180);
CreateDynamicObject(1446,counter, (Y-(PLUS_VAL*SZELESSEG)) , Z, 0.00, 0.0, 0.0);
counter = counter - PLUS_VAL;
}
counter = Y;
for(new i = 0; i < SZELESSEG; ++i) //Y
{
if(i == 0)
{
CreateDynamicObject(1446, (sarok[0]-(PLUS_VAL))+(PLUS_VAL/2)+PLUS_VAL, Y-(PLUS_VAL / 2), Z, 0.00, 0.0, 90.0); //y1
CreateDynamicObject(1446, sarok[1]+(PLUS_VAL / 2)-PLUS_VAL, Y-(PLUS_VAL / 2), Z, 0.00,0.0, 270.0); //y2
}
else if(i == SZELESSEG-1)
{
zx[ 1 ] = sarok[1] - (PLUS_VAL/2); zy[ 1 ] = counter-(PLUS_VAL);
zone[playerid] = GangZoneCreate(zx[0], zy[0], zx[1], zy[1]);
GangZoneShowForPlayer(playerid, zone[playerid],0xFFFF0096);
if(gate == 1) CreateDynamicObject(1446, sarok[0]-(PLUS_VAL/2)+PLUS_VAL, counter-(PLUS_VAL), Z, 0.00, 0.0, 90.0); //y1
else if(gate == 2) CreateDynamicObject(1446, sarok[1]+(PLUS_VAL/2)-PLUS_VAL, counter-(PLUS_VAL/2), Z, 0.00, 0.0, 270.0); //y2
else
{
CreateDynamicObject(1446, sarok[0]-(PLUS_VAL/2)+PLUS_VAL, counter-(PLUS_VAL/2), Z, 0.00, 0.0, 90.0); //y1
CreateDynamicObject(1446, sarok[1]+(PLUS_VAL/2)-PLUS_VAL, counter-(PLUS_VAL/2), Z, 0.00, 0.0, 270.0); //y2
}
}
else
{
CreateDynamicObject(1446, sarok[0]-(PLUS_VAL/2)+PLUS_VAL, counter-(PLUS_VAL/2), Z, 0.00, 0.0, 90.0); //y1
CreateDynamicObject(1446, sarok[1]+(PLUS_VAL/2)-PLUS_VAL, counter-(PLUS_VAL/2), Z, 0.00, 0.0, 270.0); //y2
}
counter = counter - PLUS_VAL;
}
SendClientMessage(playerid, -1, \"Lekreálva90\");
}
else if((180+20) > A > (180-20))
{
counter = Y - (PLUS_VAL / 2);
for(new i = 0; i < HOSSZ; ++i) //Y
{
if(i == 0) sarok[0] = counter;
if(i == HOSSZ-1) sarok[1] = counter;
CreateDynamicObject(1446, X, counter, Z, 0.00, 0.00, 270);
CreateDynamicObject(1446, (X+(PLUS_VAL*SZELESSEG)), counter, Z, 0.00, 0.0, 90);
counter = counter - PLUS_VAL;
}
counter = X;
for(new i = 0; i < SZELESSEG; ++i) //X
{
if(i == 0)
{
CreateDynamicObject(1446, X+(PLUS_VAL / 2), (sarok[0]-(PLUS_VAL))+(PLUS_VAL/2)+PLUS_VAL, Z, 0.00, 0.0, 180.0); //y1
CreateDynamicObject(1446, X+(PLUS_VAL / 2), sarok[1]+(PLUS_VAL / 2)-PLUS_VAL, Z, 0.00,0.0, 0.0); //y2
}
else if(i == SZELESSEG-1)
{
zx[ 1 ] = counter+(PLUS_VAL); zy[ 1 ] = sarok[1]-(PLUS_VAL/2);
zone[playerid] = GangZoneCreate(zx[0], zy[0], zx[1], zy[1]);
GangZoneShowForPlayer(playerid, zone[playerid],0xFFFF0096);
if(gate == 1) CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[0]-(PLUS_VAL/2)+PLUS_VAL, Z, 0.00, 0.0, 180.0); //y1
else if(gate == 2) CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[1]+(PLUS_VAL/2)-PLUS_VAL, Z, 0.00, 0.0, 0.0); //y2
else
{
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[0]-(PLUS_VAL/2)+PLUS_VAL, Z, 0.00, 0.0, 180.0); //y1
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[1]+(PLUS_VAL/2)-PLUS_VAL, Z, 0.00, 0.0, 0.0); //y2
}
}
else
{
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[0]-(PLUS_VAL/2)+PLUS_VAL, Z, 0.00, 0.0, 180.0); //y1
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[1]+(PLUS_VAL/2)-PLUS_VAL, Z, 0.00, 0.0, 0.0); //y2
}
counter = counter + PLUS_VAL;
}
SendClientMessage(playerid, -1, \"Lekreálva180\");
}
else if(A < 360 && A > 340 || A < 20 && A > 0 )
{
counter = Y + (PLUS_VAL / 2);
for(new i = 0; i < HOSSZ; ++i) //Y
{
if(i == 0) sarok[0] = counter;
if(i == HOSSZ-1) sarok[1] = counter;
CreateDynamicObject(1446, X, counter, Z, 0.00, 0.00, 270);
CreateDynamicObject(1446, (X-(PLUS_VAL*SZELESSEG)), counter, Z, 0.00, 0.0, 90);
counter = counter + PLUS_VAL;
}
counter = X - (PLUS_VAL);
for(new i = 0; i < SZELESSEG; ++i) //X
{
if(i == 0)
{
CreateDynamicObject(1446, X-(PLUS_VAL / 2), sarok[0]+(PLUS_VAL / 2)-PLUS_VAL, Z, 0.00, 0.0, 0.0); //y1
CreateDynamicObject(1446, X-(PLUS_VAL / 2), sarok[1]-(PLUS_VAL / 2)+PLUS_VAL, Z, 0.00,0.0, 180.0); //y2
}
if(i == SZELESSEG-1)
{
zx[ 1 ] = counter; zy[ 1 ] = sarok[1]+(PLUS_VAL/2);
zone[playerid] = GangZoneCreate(zx[0], zy[0], zx[1], zy[1]);
GangZoneShowForPlayer(playerid, zone[playerid],0xFFFF0096);
if(gate == 1) CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[0]-(PLUS_VAL/2), Z, 0.00, 0.0, 0.0); //y1
else if(gate == 2) CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[1]+(PLUS_VAL/2), Z, 0.00, 0.0, 180.0); //y2
else
{
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[0]-(PLUS_VAL/2), Z, 0.00, 0.0, 0.0); //y1
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[1]+(PLUS_VAL/2), Z, 0.00, 0.0, 180.0); //y2
}
}
else
{
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[0]-(PLUS_VAL/2), Z, 0.00, 0.0, 0.0); //y1
CreateDynamicObject(1446, counter-(PLUS_VAL/2)+PLUS_VAL, sarok[1]+(PLUS_VAL/2), Z, 0.00, 0.0, 180.0); //y2
}
counter = counter - PLUS_VAL;
}
SendClientMessage(playerid, -1, \"Lekreálva0\");
} else return 0;
return 1;
}
Screenshotok:http://www.kephost.com/images4/2013/8/3/a1_2013_8_3_uti0zyegnd.pnghttp://www.kephost.com/images4/2013/8/3/a1_2013_8_3_hnnd1d5ed4.pnghttp://www.kephost.com/images4/2013/8/3/a1_2013_8_3_un4i3ebha2.pngPluginok, amiket felhasználtam:Incognito\'s Streamer
ZCMD
SSCANF
Update: azért angol-magyar mert külföldi fórumra raktam ki elõször a szkriptet. Mielõtt valaki belekötne. (
http://forum.sa-mp.com/showthread.php?t=480462 )