Checkpoint - 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: Checkpoint (
/showthread.php?tid=68571)
Checkpoint -
Puzi - 11.03.2009
Hey, I just want to make a small checkpoint that shows house information when you get into it. For example:
Код:
=== MAP NAME ===
Owner: Player
Price: $30,000
For sale: No
House ID: 1 (this is for the map, I just want every house to have a number so we know after each ID, the house that we are talking about
Is it possible to make? If yes, please gimme the code, i would appreciate it
P.S - I saw it on one Truck Server, so it should be possible
//edit: P.P.S - Do you know any good vehicle streamer? Sorry for off-topic, just asking here, not bothered to write a new topic
Thanks and Greetings
Puzi
Re: Checkpoint -
Coicatak - 12.03.2009
pawn Код:
forward InfoText(); //forward the function
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); //This will be used to check player's position
public OnGameModeInit()
{
SetTimer("InfoText", 1000, 1); //sets it to a timer which will be called every seconds
return 1;
}
public InfoText() //This will check player position and send a message if he's in the zone you defined.
{
for (new i =0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerToPoint(5.0, i, x, y, z)) //5.0 is the radi, i is playerid and x,y,z are coordinates of the circle center
{
SendClientMessage(i, color," === MAP NAME ==="); replace color with your color code
//Add the rest of your text
}
}
}
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) //By ****** if I'm not wrong
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
I hoe it helped you