07.11.2010, 19:48
(
Последний раз редактировалось GooMan; 07.11.2010 в 23:22.
)
Hello Dear SAMP'ler,
I have a bigger problem. I am trying to create nodm zones, but somehow it does not work. It appears only on the BSN textdraw. I know it is German, I asked already in the German SAMP forum. But nobody told me there helped. I hope you help me
I have a bigger problem. I am trying to create nodm zones, but somehow it does not work. It appears only on the BSN textdraw. I know it is German, I asked already in the German SAMP forum. But nobody told me there helped. I hope you help me
pawn Код:
#include <a_samp>
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF000096
new gz1,gz2,gz3;
new checktimer;
new bsnzone;
new bsn[MAX_PLAYERS];
new Text:Textdraw0;
forward check();
forward IsPlayerInArea(playerid,Float:minX,Float:minY,Float:maxX,Float:maxY);
public OnFilterScriptInit()
{
bsnzone = GangZoneCreate(1094.37, -1038.38, 1280.709, -864.6794);
gz1 = GangZoneCreate(-1998.261352,217.670394,-1943.742919,75.112503);
gz2 = GangZoneCreate(-2014.019653,-76.365303,-2095.187255,-101.865203);
gz3 = GangZoneCreate(-2612.293945,573.630126,-2711.304199,640.149353);
checktimer = SetTimer("check",1000,1);
Textdraw0 = TextDrawCreate(549.000000,32.000000,"No DM Zone");
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,3);
TextDrawLetterSize(Textdraw0,0.399999,1.000000);
TextDrawColor(Textdraw0,0xff0000ff);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);
return 1;
}
public OnFilterScriptExit()
{
KillTimer(checktimer);
return 1;
}
public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, bsnzone, COLOR_RED);
GangZoneShowForPlayer(playerid,gz1,COLOR_GREEN);
GangZoneShowForPlayer(playerid,gz2,COLOR_GREEN);
GangZoneShowForPlayer(playerid,gz3,COLOR_GREEN);
return 1;
}
public OnPlayerConnect(playerid)
{
bsn[playerid] = 0;
return 1;
}
stock IsPlayerInArea(playerid,Float:minX,Float:minY,Float:maxX,Float:maxY)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
if(pX >= minX && pX <= maxX && pY >= minY && pY <= maxY) return 1;
else return 0;
}
public check()
{
new Waffe,ammo;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,25.0,-1998.261352,217.670394,-1943.742919))
{
TextDrawShowForPlayer(i,Textdraw0);
//ResetPlayerWeapons(i);//verhindert aufjedenfall DM am BSN ;) MAn kriegt sie aber nicht wieder.
bsn[i] = 1;
printf("Area BSN (%i)",bsn[i]);
}
else
{
if(bsn[i] == 1)
{
TextDrawHideForPlayer(i,Textdraw0);
GivePlayerWeapon(i,Waffe,ammo);
bsn[i] = 0;
printf("Nicht in Area (%i)",bsn[i]);
}
}
if(IsPlayerInArea(i,-1998.261352,217.670394,-1943.742919,75.112503) || IsPlayerInArea(i,1094.37, -1038.38, 1280.709, -864.6794))
{
TextDrawShowForPlayer(i,Textdraw0);
//ResetPlayerWeapons(i);//verhindert aufjedenfall DM am BSN ;) MAn kriegt sie aber nicht wieder.
bsn[i] = 1;
printf("Area BSN (%i)",bsn[i]);
}
else
{
if(bsn[i] == 1)
{
TextDrawHideForPlayer(i,Textdraw0);
GivePlayerWeapon(i,Waffe,ammo);
bsn[i] = 0;
printf("Nicht in Area (%i)",bsn[i]);
}
}
printf("Nicht in Area (%i)",bsn[i]);
}
return 1;
}