Is there a way to detect play leaving a pickup?
#1

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.
Reply
#2

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);
Reply
#3

ok thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)