SA-MP Forums Archive
How i can do 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How i can do this??? (/showthread.php?tid=249411)



How i can do this??? - Bilawal2050 - 18.04.2011

I want to make a money bag when player find a money bag he got 100 on every second and on player kill the money bag drop and other pic and got 100 on every sec ?? plz help its to samll plz help


Re: How i can do this??? - maramizo - 18.04.2011

https://sampforum.blast.hk/showthread.php?tid=187229


Re: How i can do this??? - Bilawal2050 - 18.04.2011

Plz help how i make this


Re: How i can do this??? - park4bmx - 18.04.2011

just create a pickup like a briefcase or whatever you want then OnPlayerEnterPickUp just give the player the money GiveMoney...



Re: How i can do this??? - Bilawal2050 - 18.04.2011

no read carefully and then


Re: How i can do this??? - Mean - 18.04.2011

He got 100 of what on every second, explain more, I don't understand.

EDIT: I think I understand:

pawn Код:
new pickup, timer;

public OnGameModeInit( )
{
    pickup = CreatePickup( 1550, 19, Float:X, Float:Y, Float:Z, 0 ) // change where you want the moneybag to be at beginning.
    return 1;
}

public OnPlayerPickUpPickup( playerid, pickupid )
{
    if( pickupid == pickup )
    {
        timer = SetTimerEx( "CashTimer", 1000, 1, "i", playerid );
        SetPVarInt( playerid, "HasBag", 1 );
    }
    return 1;
}

public OnPlayerDeath( playerid, killerid, reason )
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos( playerid, x, y, z );
    if( GetPVarInt( playerid, "HasBag" ) == 1 )
    {
        DestroyPickup( pickup );
        pickup = CreatePickup( 1550, 19, x, y + 3, z, 1 );
        SetPVarInt( playerid, "HasBag", 0 );
        KillTimer( timer );
    }
    return 1;
}

forward CashTimer( playerid )
{
    GivePlayerMoney( playerid, 100 );
    return 1;
}



Re: How i can do this??? - Stigg - 18.04.2011

Quote:
Originally Posted by Mean
Посмотреть сообщение
He got 100 of what on every second, explain more, I don't understand.
1OO buck's a second.


Re: How i can do this??? - Bilawal2050 - 18.04.2011

no 100$ on every time


Re: How i can do this??? - Stigg - 18.04.2011

Quote:
Originally Posted by Bilawal2050
Посмотреть сообщение
no 100$ on every time
Just a heads up:

$100 = 100 buck's.


Re: How i can do this??? - Maftaca - 18.04.2011

I understand what Bilawal want, he wanted a Bag [like SWAT4]... that if you OnPlayerEnterPickup, it GivePlayerMoney(playerid, 100); every 1 sec, after this... only who get it, it stays in the actor who Enter it..

And if player Dead, the pickup[Money BAG] fall from player, other player can got it!!!


Re: How i can do this??? - Emmet_ - 18.04.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Just a heads up:

$100 = 100 buck's.
Your post wasn't needed.

pawn Код:
new HasMoneyBag[MAX_PLAYERS];
new MONEYBAG;

public OnGameModeInit()
{
    MONEYBAG = CreatePickup(1550, 23, 0.0, 0.0, 0.0);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == MONEYBAG)
    {
        HasMoneyBag[playerid] = 1;
        DestroyPickup(MONEYBAG);
        GivePlayerMoney(playerid, 100);
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(HasMoneyBag[playerid])
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        HasMoneyBag[playerid] = 0;
        MONEYBAG = CreatePickup(1550, 2, x + 1.0, y - 1.0, z);
    }
    return 1;
}
Was that hard?


Re: How i can do this??? - Stigg - 18.04.2011

Quote:
Originally Posted by 69Playa
Посмотреть сообщение
Your post wasn't needed.
Why was'nt it needed ? I was replying Bilawal2050.
I think you meant your post was'nt needed, so keep your kneb out.


Re: How i can do this??? - Emmet_ - 18.04.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Why was'nt it needed ? I was replying Bilawal2050.
I think you meant your post was'nt needed, so keep your kneb out.
My post wasn't needed? Negative comments get you know where, but drags you closer to receiving an infraction. I was just helping him, providing code (whilst you were posting something useless!) so there's no need to go off-topic here and post negative comments towards a guy who's trying to help a fella who needs something.


Re: How i can do this??? - Stigg - 18.04.2011

Quote:
Originally Posted by 69Playa
Посмотреть сообщение
My post wasn't needed? Negative comments get you know where, but drags you closer to receiving an infraction. I was just helping him, providing code (whilst you were posting something useless!) so there's no need to go off-topic here and post negative comments towards a guy who's trying to help a fella who needs something.
You edited out the knaff comment about the user to learning to script from your post.
I'm not getting into a argument about it, just practice what you preach.


Re: How i can do this??? - Emmet_ - 18.04.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
You edited out the knaff comment about the user to learning to script from your post.
I'm not getting into a argument about it, just practice what you preach.
You're right, however, I was being harsh to the guy and he needed help so I just took it out of my post.

I'm out of this thread, too much unnecessary off-topic garbage here, and it's starting to form into a fucking war.


Re: How i can do this??? - Mean - 19.04.2011

I already posted the code, so it is pretty useless 69Playa.