Warning System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Warning System (
/showthread.php?tid=196729)
Warning System -
Infinitas - 06.12.2010
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?
Re: Warning System -
SkizzoTrick - 06.12.2010
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);
}
Re: Warning System -
Infinitas - 06.12.2010
Testing Now.
Re: Warning System -
SkizzoTrick - 06.12.2010
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