bounties saving
#1

hello. I need that so bounties would save, and to do that I must make some new commands (to make it easier). I know how to save it, but dont know how to make those extra thing. this is all I came up with yet
Код:
GetPlayerHitman(playerid)
{
	bounty[giveplayerid]+=moneys;
}
and I need GetPlayerHitman and SetPlayerHitman.
P.S - I`m using SananMoneyGroup 0.5 hitman script, and this bounties script that I use now (I`ll edit it later) Pastebin
Reply
#2

Код:
new Hitman[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
  Hitman[playerid]=0; // This is very important to prevent bugs !
}

public OnPlayerDisconnect(playerid, reason)
{
  dUserSetINT(PlayerName(playerid)).("Hitman",GetPlayerHitman(playerid));
}

stock GivePlayerHitman(playerid, hitman)
{
	Hitman[playerid] = Hitman[playerid] + hitman;
	return Hitman[playerid];
}

stock GetPlayerHitman(playerid)
{
	return Hitman[playerid];
}
This is an example how would i do.
I use this for everything, but you should make it like jobs, or you will have more work !

Best Regards !
Reply
#3

that on onplayerconnect resets bountie or what?
P.S - thanx
Reply
#4

No, it's just prevents bugs.

Then you have to add (to make the player hitman again) :

Код:
 
GivePlayerHitman(playerid,dUserINT(PlayerName(playerid)).("Hitman")-GetPlayerhitman(playerid));
And use dudb.inc !
Reply
#5

ok thanx
Reply
#6

btw you need this too :

Код:
stock PlayerName(playerid) 
{
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}
Sorry i am always making mistakes
Reply
#7

You don't need 255, it's too long, MAX_PLAYER_NAME is enough.

pawn Код:
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)