Moneybag System Help
#1

i have a problem with my moneybag system.
when i touch ICON House, i will get moneybag
but moneybag system is not started

this my code
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	new str[128];
	if(pickupid == MoneyBagPickup)
    {
		new money = MoneyBagCash;
		new str2[140];
     	format(str2, sizeof(str2), "MONEYBAG: %s(%d) found the Money Bag that had inside "COL_GREEN"$%d, "white"Located in: "red"%s", GetName(playerid), playerid, money, MoneyBagLocation);
        SendClientMessageToAll(COLOR_WHITE, str2);
		MoneyBagFound = 1;
        DestroyPickup(MoneyBagPickup);
        SendClientMessage(playerid, COLOR_LIME, "[MoneyBag]: You've found the money bag!");
		GivePlayerCash(playerid, money);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
        return 1;
    }
	if(pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8] || pickupid == Pickup[9] || pickupid == Pickup[10] || pickupid == Pickup[11] || pickupid == Pickup[12] || pickupid == Pickup[13] ||
	   pickupid == Pickup[14] || pickupid == Pickup[15] || pickupid == Pickup[16] || pickupid == Pickup[17])
	{
	    if(pVehicles[playerid] != -1)
	    {
	        for(new i; i < MAX_PLAYERS; i++)
	        {
	            if(IsPlayerConnected(i))
	            {
	        		if(IsPlayerInVehicle(i,  pVehicles[playerid])) DestroyVehicle(pVehicles[playerid]);
				}
			}
	    }
	    DestroyVehicle(pVehicles[playerid]);
	    new Float:x, Float:y, Float:z, Float:a;
	    GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
		pVehicles[playerid] = AddStaticVehicle(522, x, y, z, a, -1, -1);
		PutPlayerInVehicle(playerid, pVehicles[playerid], 0);
	for(new i = 0; i < MAX_HOUSE; i++)
	{
		if(pickupid == House[i][PickupU]) return 1;
	}
	return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
	for(new i = 0; i < MAX_HOUSE; i++)
	{
		if(pickupid == House[i][PickupU]) return 1;
	}
	return 1;
}
Reply
#2

Quote:

Create the moneybag as dymamic, add them all into one pickup check fxn.

can you show me in code?
Reply
#3

Код:
public MoneyBag()
{
	if(!MoneyBagFound)
	{
		format(strg, sizeof(strg), ""red"MONEYBAG: "white"The "yellow"money bag "white"still hasn't been found in: "orange"%s", MoneyBagLocation);
		SendClientMessageToAll(-1, strg);
	}
	else if(MoneyBagFound)
	{
		MoneyBagFound = 0;
		new randombag = random(sizeof(MBSPAWN));
		MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
		MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
		MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
		format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Positions]);
		format(strg, sizeof(strg), ""red"MONEYBAG: "white"A Money Bag is placed somewhere in "yellow"%s, "white"Go for it. It contains big cash!", MoneyBagLocation);
		SendClientMessageToAll(-1, strg);
		DestroyPickup(MoneyBagPickup);
		MoneyBagPickup = CreatePickup(1550, 2, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1);
	}
	return 1;
}
this ?
Reply
#4

Код:
public MoneyBag()
{
	if(!MoneyBagFound)
	{
		format(strg, sizeof(strg), ""red"MONEYBAG: "white"The "yellow"money bag "white"still hasn't been found in: "orange"%s", MoneyBagLocation);
		SendClientMessageToAll(-1, strg);
	}
	else if(MoneyBagFound)
	{
		MoneyBagFound = 0;
		new randombag = random(sizeof(MBSPAWN));
		MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
		MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
		MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
		format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Positions]);
		format(strg, sizeof(strg), ""red"MONEYBAG: "white"A Money Bag is placed somewhere in "yellow"%s, "white"Go for it. It contains big cash!", MoneyBagLocation);
		SendClientMessageToAll(-1, strg);
		DestroyPickup(MoneyBagPickup);
		MoneyBagPickup = CreatePickup(1550, 2, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1);
	}
	return 1;
}
this my code
Reply
#5

please ANYBODY HELP!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)