Is there a way to detect play leaving a pickup? - 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)
+--- Thread: Is there a way to detect play leaving a pickup? (
/showthread.php?tid=416861)
Is there a way to detect play leaving a pickup? -
jueix - 18.02.2013
Hi I am wondering if there's a way to detect if a player leave's, I am editing a house system by antionx or something for my server and was wondering if you could detect if a player leave's a pickup with out isplayerinrangeofpoint.
For example when he enter's the pick up this code function's.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(GetHouseID(playerid) != -255) GetHouseStats(playerid, GetHouseID(playerid));
return 1;
}
stock GetHouseStats(playerid, hid)
{
new str2[256];
new Text:startgame;
new Text:options;
format(str2, sizeof(str2), "Owner: %s", hInfo[hid][Name]);
SendClientMessage(playerid, c_y, str2);
//text draws start menu
startgame = TextDrawCreate(239.5 ,127 , str2);
TextDrawFont(startgame , 3);
TextDrawLetterSize(startgame , 1.0, 9.1);
TextDrawColor(startgame , 0x0022ffFF);
TextDrawSetOutline(startgame , false);
TextDrawSetProportional(startgame , true);
TextDrawSetShadow(startgame , 1);
if(strcmp(hInfo[hid][Renter],"ForRent",true))
{
format(str2, sizeof(str2), "Rented by: %s", hInfo[hid][Renter]);
SendClientMessage(playerid, c_y, str2);
}
if(PlayerInfo[playerid][AdminLevel] == 6)
{
format(str2, sizeof(str2), "House id: %d House vw: %d", GetHouseID(playerid), hInfo[hid][Virtualworld]);
SendClientMessage(playerid, COLOR_ORANGE, str2);
}
format(str2,sizeof(str2),"Cost: %i",hInfo[hid][Cost]);
SendClientMessage(playerid, c_y, str2);
options = TextDrawCreate(279.5 ,207 , str2);
TextDrawFont(options , 3);
TextDrawLetterSize(options , 1.0, 9.1);
TextDrawColor(options , 0x0022ffFF);
TextDrawSetOutline(options , false);
TextDrawSetProportional(options , true);
TextDrawSetShadow(options , 1);
TextDrawShowForPlayer(playerid, startgame); // Show the SF option
TextDrawShowForPlayer(playerid, options); // Show the LV option
}
I want it so when the player leave's the pickup the textdraw's will hide.
Re: Is there a way to detect play leaving a pickup? -
pasha97 - 18.02.2013
Quote:
Originally Posted by jueix
Hi I am wondering if there's a way to detect if a player leave's, I am editing a house system by antionx or something for my server and was wondering if you could detect if a player leave's a pickup with out isplayerinrangeofpoint.
For example when he enter's the pick up this code function's.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid) { if(GetHouseID(playerid) != -255) GetHouseStats(playerid, GetHouseID(playerid)); return 1; }
stock GetHouseStats(playerid, hid) { new str2[256]; new Text:startgame; new Text:options; format(str2, sizeof(str2), "Owner: %s", hInfo[hid][Name]); SendClientMessage(playerid, c_y, str2); //text draws start menu startgame = TextDrawCreate(239.5 ,127 , str2); TextDrawFont(startgame , 3); TextDrawLetterSize(startgame , 1.0, 9.1); TextDrawColor(startgame , 0x0022ffFF); TextDrawSetOutline(startgame , false); TextDrawSetProportional(startgame , true); TextDrawSetShadow(startgame , 1); if(strcmp(hInfo[hid][Renter],"ForRent",true)) { format(str2, sizeof(str2), "Rented by: %s", hInfo[hid][Renter]); SendClientMessage(playerid, c_y, str2); } if(PlayerInfo[playerid][AdminLevel] == 6) { format(str2, sizeof(str2), "House id: %d House vw: %d", GetHouseID(playerid), hInfo[hid][Virtualworld]); SendClientMessage(playerid, COLOR_ORANGE, str2); } format(str2,sizeof(str2),"Cost: %i",hInfo[hid][Cost]); SendClientMessage(playerid, c_y, str2); options = TextDrawCreate(279.5 ,207 , str2); TextDrawFont(options , 3); TextDrawLetterSize(options , 1.0, 9.1); TextDrawColor(options , 0x0022ffFF); TextDrawSetOutline(options , false); TextDrawSetProportional(options , true); TextDrawSetShadow(options , 1); TextDrawShowForPlayer(playerid, startgame); // Show the SF option TextDrawShowForPlayer(playerid, options); // Show the LV option }
I want it so when the player leave's the pickup the textdraw's will hide.
|
Without IsPlayerInRangeOfPoint this feature can be scripted using Streamer plugin. You have to use:
Код:
forward OnPlayerEnterDynamicArea(playerid, areaid);
OnPlayerLeaveDynamicArea(playerid, areaid);
native CreateDynamicCircle(Float:x, Float:y, Float:size, worldid = -1, interiorid = -1, playerid = -1);
Re: Is there a way to detect play leaving a pickup? -
jueix - 18.02.2013
ok thanks