where is wrong here??
#1

no errors no warning but not work any help ??
pawn Код:
public killzone(playerid)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= 1331.278 && X <= 2207.118 && Y >= -2755.979 && Y <= -2125.373)
    {
    SendClientMessage(playerid,COLOR_RED,"you are in ADMIN ZONE!!!");
    print("admin zone violated");
        SetPlayerHealth(playerid,0);
    }
    return 1;
}
Reply
#2

Well, the code is okey. Can you post the code/command/timer when you use/start it?
Reply
#3

only this under ongamemodeint
pawn Код:
SetTimer("killzone",1000,1);
pawn Код:
forward killzone(playerid);
Reply
#4

pawn Код:
public killzone(playerid)
{
for(playerid=0; playerid<MAX_PLAYERS; playerid++)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= 1331.278 && X <= 2207.118 && Y >= -2755.979 && Y <= -2125.373)
    {
    SendClientMessage(playerid,COLOR_RED,"you are in ADMIN ZONE!!!");
    print("admin zone violated");
        SetPlayerHealth(playerid,0);
    }
}
    return 1;
}

Try this.
Reply
#5

yeah work fine thx and how to make if im a admin not kill me?
pawn Код:
public killzone(playerid)
{
for(playerid=0; playerid<MAX_PLAYERS; playerid++)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= 1331.278 && X <= 2207.118 && Y >= -2755.979 && Y <= -2125.373)
    {
        SendClientMessage(playerid,COLOR_RED,"you are in ADMIN ZONE!!!");
        print("admin zone violated");
        SetPlayerHealth(playerid,0);
        }
        else if(!IsPlayerAdmin(playerid))
        {
        }
    }
    return 1;
}
this can work?
Reply
#6

Quote:
Originally Posted by gigi1223
Посмотреть сообщение
only this under ongamemodeint
pawn Код:
SetTimer("killzone",1000,1);
pawn Код:
forward killzone(playerid);
The problem is with your timer change it to this:

SetTimerEx("killzone", 1000, 0, "d", playerid);
Reply
#7

now work -.- read up ihave a question now read up
Reply
#8

Quote:
Originally Posted by Script
Посмотреть сообщение
The problem is with your timer change it to this:

SetTimerEx("killzone", 1000, 0, "d", playerid);
Why SetTimerEx? SetTimer would work aswell.

Try:

pawn Код:
if(PlayerAdmin[playerid] == 1)
{
//Nothing as the player is an admin.
}
else
{
//Code Here.
}
Reply
#9

yea work but i want if is a admin send a message welcome admin but this message show 100000 times XD how to show 1 times?
pawn Код:
if(PlayerAdmin[playerid] = 1)
{
SendClientMessage .......... welcome admin
}
else
{
//Code Here.
}
Reply
#10

Quote:
Originally Posted by gigi1223
Посмотреть сообщение
yea work but i want if is a admin send a message welcome admin but this message show 100000 times XD how to show 1 times?
pawn Код:
if(PlayerAdmin[playerid] = 1)
{
SendClientMessage .......... welcome admin
}
else
{
//Code Here.
}
That is cuz your time is checking every 1 second, meaning that the admin would get the message every 1 second. Try:

pawn Код:
public killzone(playerid)
{
    for(playerid=0; playerid<MAX_PLAYERS; playerid++)
    {
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        if(X >= 1331.278 && X <= 2207.118 && Y >= -2755.979 && Y <= -2125.373)
        {
            SendClientMessage(playerid,COLOR_RED,"You're in the Admin Zone, and will be killed.");
            print("Admin Zone Violated");
            SetPlayerHealth(playerid,0);
        }
        else if(!IsPlayerAdmin(playerid))
        {
            SendClientMessage(playerid,COLOR_RED,"Welcome to Admin Zone!"); //Send the message for the admin.
            KillTimer("killzone") // Kill the timer if the player is an admin.
        }
    }
    return 1;
}
pawn Код:
forward killzone(playerid);
Under OnPlayerConnect
pawn Код:
SetTimerEx("killzone", 1000, 1, "d", playerid);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)