18.04.2011, 18:02
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


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;
}
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;
}
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. |