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;
}
SetTimer("killzone",1000,1);
forward killzone(playerid);
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;
}
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;
}
only this under ongamemodeint
pawn Код:
pawn Код:
|
The problem is with your timer change it to this:
SetTimerEx("killzone", 1000, 0, "d", playerid); |
if(PlayerAdmin[playerid] == 1)
{
//Nothing as the player is an admin.
}
else
{
//Code Here.
}
if(PlayerAdmin[playerid] = 1)
{
SendClientMessage .......... welcome admin
}
else
{
//Code Here.
}
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 Код:
|
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;
}
forward killzone(playerid);
SetTimerEx("killzone", 1000, 1, "d", playerid);