Safezone Help !!
#1

hey guys i need help with some script .
im making an Safezone . when player kill someone in RedZone or Safezone the Killerid get automatically kick .

this is the Safezone code
// top of the script
new Safezone;

public OnGameModeInit()
{
Safezone = GangZoneCreate(-2529.877, -684.1067, -2502.838, -593.3725);

public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, Safezone, 0xFF0000AA);

help pls
Reply
#2

get automatically?
Reply
#3

get automaticly what?..
Reply
#4

lolz miss some text xDD

Get Automatically kick
Reply
#5

Reall. A part of text is missing lol
Reply
#6

lolz
Reply
#7

Try:

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
IsPlayerInRangeOfPoint(killerid85.0, -2510.0, -640.011.0))
    {
        
SendClientMessage(killerid,0xFFFFFFFF,"You are not allowed to kill players in this zone!!");
        
kick(killerid);
    }

Reply
#8

I would do
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        if(isplayeringangzone[playerid] = Safezone) //You must have a stock (wich i dont have i just made it
       {
              Kick(killerid);
     }
}
return 1;
Reply
#9

Quote:
Originally Posted by axxelac
Посмотреть сообщение
I would do
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        if(isplayeringangzone[playerid] = Safezone) //You must have a stock (wich i dont have i just made it
       {
              Kick(killerid);
     }
}
return 1;
hmm i dont have the stock , and its difficult for me cause im still new in scripting
Reply
#10

pawn Код:
#define MAX_ZONES 100

enum gzinfo
{
  Float:gmaxX,
  Float:gmaxY,
  Float:gminY,
  Float:gminX,
};

new Zone[MAX_ZONES][gzinfo];
new LastZone = 0;

GangZoneCreate2(Float:minx, Float:miny, Float:maxx, Float:maxy)
{
  GangZoneCreate(minx,miny,maxx,maxy);
  Zone[LastZone][gminX]=minx;
  Zone[LastZone][gminY]=miny;
  Zone[LastZone][gmaxX]=maxx;
  Zone[LastZone][gmaxY]=maxy;
  LastZone++;
  return 1;
}

IsPlayerInGangZone(playerid,gangzoneid)
{
  new Float:Pos[3];
  GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  if( Pos[0] >= Zone[gangzoneid][gminX] && Pos[0] <= Zone[gangzoneid][gmaxX] && Pos[1] >= Zone[gangzoneid][gminY] && Pos[1] <= Zone[gangzoneid][gmaxY] ) return 1;
  else return 0;

}

GetPlayerZone(playerid)
{
    for( new g=0; g<MAX_ZONES; g++)
    {
        if( IsPlayerInGangZone(playerid, g) )
        {
            return Zone[g][gzinfo]; /*error*/
        }
    }
   
    return g;
}
Reply
#11

thats all ? let me try
Reply
#12

Код:
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(2255) : warning 203: symbol is never used: "GangZoneCreate2"
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(2255) : warning 203: symbol is never used: "GetPlayerZone"
C:\Users\user\Desktop\SAMP server 0.3e\gamemodes\DriftVision.pwn(2255) : warning 203: symbol is never used: "IsPlayerInGangZone"
i got this
Reply
#13

its not works
. . :\ anyone else ?? help me
Reply
#14

you never used GetPlayerZone, GangZoneCreate2 and IsPlayerInGangZone
The compiler just remind you to use them

EDIT: use IsPlayerInArea it has minx/y/maxx/y

MinX/Y/Maxx/Y is use in GangZones
Reply
#15

im using Xtreme Vehicle Plotter to make the Zone
Reply
#16

Quote:
Originally Posted by pasha97
Посмотреть сообщение
Try:

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
IsPlayerInRangeOfPoint(killerid85.0, -2510.0, -640.011.0))
    {
        
SendClientMessage(killerid,0xFFFFFFFF,"You are not allowed to kill players in this zone!!");
        
kick(killerid);
    }

This should work, but 'kick' should be 'Kick'
Reply
#17

Well done, the last one has just worked on my gamemod without kick.
maybe its usefull if it has message
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)