SA-MP Forums Archive
How To Make This - 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: How To Make This (/showthread.php?tid=483945)



How To Make This - moustafa0550 - 28.12.2013

My Gamemods Dcmd
i Want Make Createpickup Dcmd
and i After this i createpickup this Star Wanted
i want only Any One Goto Take it Dissapear 1 Wanted And He is Can Take it Again After 2 Mins
i want all this Dcmd Any One Can Please!!! Please and + rep
thanx


Re: How To Make This - Tayab - 28.12.2013

Try this.

Change the x,y,z to your choise
pawn Код:
//Under the includes
new WantedPickup


public OnPlayerConnect(playerid)
{
    WantedPickup = CreatePickup(1247,2,x,y,z,0);
}
public OnPlayerPickupPickup(playerid,pickupid)
{
    switch(pickupid)
    {
        case WantedPickup:
        {
            if(IsPlayerInRangeOfPoint(playerid,2,x,y,z))
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
        }
    }
    return 1;


}
EDIT: Fixed!


Re: How To Make This - TheOriginal1337 - 28.12.2013

Tayab, you'll also need to add a code to get their x, y & z coords.


Re: How To Make This - Spydah - 28.12.2013

I don't know what you mean, you want that star as pickup or?..


Re: How To Make This - xVIP3Rx - 28.12.2013

Here's a full system..
pawn Код:
#define WANTEDSTAR_RESPAWN_TIME     120 //Seconds = 2 Minutes

new const Float: WantedStars[][3] =
{
    { X, Y, Z }, //Change the X|Y|Z to your cords
    { X, Y, Z },
    { X, Y, Z },
    { X, Y, Z },
    { X, Y, Z },
    { X, Y, Z }
};

new WantedStarPickup[sizeof(WantedStars)];

public OnGameModeInit()
{
    for(new i; i < sizeof(WantedStars); i++) WantedStarPickup[i] = CreatePickup(1247, 1, WantedStars[i][0], WantedStars[i][1], WantedStars[i][2]);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new i; i<sizeof(WantedStars); i++)
    {
        if(pickupid == WantedStarPickup[i] && GetPlayerWantedLevel(playerid) > 0)
        {
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 1);
            DestroyPickup(WantedStarPickup[i]);
            SetTimerEx("RespawnWantedStar", 1000*WANTEDSTAR_RESPAWN_TIME, false, "i", i);
            return 1;
        }
    }
    return 1;
}

forward RespawnWantedStar(i);
public RespawnWantedStar(i)
{
    WantedStarPickup[i] = CreatePickup(1247, 1, WantedStars[i][0], WantedStars[i][1], WantedStars[i][2]);
}
Just change the X|Y|Z to the ones you want.