How To Make This
#1

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

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!
Reply
#3

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)