Warning System
#1

no, not a admin one :P

I want to make a warning system. Take area 69 for example. I want to make somthing like this.

if player is in 500 meters of (A cord from Area69) then they will get a message saying "WARNING 1 BLA BLA BLA"

then if player is in 300 meters of the same cord, they will get a message saying "WARNING 2 BLA BLA BLA" so on and so forth.

I know there is a way to do it, i've seen it.

Any help?
Reply
#2

You need to create a varible in the player's account,named pAreaWarns.Then do this

use
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid,30.0,x,y,z))//This will check if the player left the area
      {
      PlayerInfo[playerid][pAreaWarns] = 0;
      GameTextForPlayer(playerid,"You left the area",5000,5);
      return 1;
      }
if(IsPlayerInRangeOfPoint(playerid,30.0,x,y,z))//First warning,300 feets
      {
       GameTextForPlayer(playerid,"Warning 1!",5000,5);
       PlayerInfo[playerid][pAreaWarns] = 1;
      }

else if(IsPlayerInRangeOfPoint(playerid,20.0,x,y,z))//Second 200 feets
      {
       GameTextForPlayer(playerid,"Warning 2!",5000,5);
       PlayerInfo[playerid][pAreaWarns] = 2;
      }

else if(IsPlayerInRangeOfPoint(playerid,10.0,x,y,z))//Third,DEATH
      {
       GameTextForPlayer(playerid,"Warning 3!Your getting shooted",5000,5);
       PlayerInfo[playerid][pAreaWarns] = 3;
       SetPlayerHealth(playerid,0);
      }
Reply
#3

Testing Now.
Reply
#4

But first you need to check if the player is there NONSTOP
Im not very good in timers but i saw this reply


Quote:
Originally Posted by TheXIII
Посмотреть сообщение
Something like this?
pawn Код:
// Global array
new FindCPTimer[MAX_PLAYERS];
// Under Command
FindCPTimer[playerid] = SetTimerEx("SyncFindCP", 1000, true, "ii", playerid, player);

// Function under timer
public SyncFindCP(Looking, ToFind)
{
    if( IsPlayerConnected(ToFind) )
    {
        new Float:ToFindPos[3];
        GetPlayerPos(ToFind, ToFindPos[0], ToFindPos[1], ToFindPos[2]);
        SetPlayerCheckPoint(Looking, ToFindPos[0], ToFindPos[1], ToFindPos[2]);
    }
    else{
        DisablePlayerCheckPoint(Looking);
        KillTimer(FindCPTimer[playerid]);
    }
    return 1;
}
Ofc,this needs to be edited
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)