no, i have bounty command. This is whole script for bounty,
pawn Код:
//HITMAN------------------------------------------------------------------------
if(strcmp(cmd, "/hitman", true) == 0) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "{8FE11F}** {C8D1CC}/hitman [id] [daudzums]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "{8FE11F}** {C8D1CC}/hitman [id] [daudzums]");
return 1;
}
moneys = strval(tmp);
if(moneys > GetPlayerMoney(playerid)) {
SendClientMessage(playerid, COLOR_GREY, "{ff0000}** {C8D1CC}Jums nepietiek naudas!");
return 1;
}
if(moneys < 500) {
SendClientMessage(playerid, COLOR_GREY, "{ff0000}** {C8D1CC}Minimālā summa $500!");
return 1;
}
if(IsPlayerConnected(giveplayerid)==0) {
SendClientMessage(playerid, COLOR_GREY, "{ff0000}** {C8D1CC}Љāds spēlētājs neeksistē!");
return 1;
}
bounty[giveplayerid]+=moneys;
GivePlayerMoney(playerid, 0-moneys);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Uz spēlētāja %s tika uzlikta $%d liela atlīdzība, no spēlētāja %s [Kopā: $%d].", giveplayer, moneys, sendername, bounty[giveplayerid]);
SendClientMessageToAll(COLOR_ORANGE, string);
format(string, sizeof(string), "Uz jums tika uzlikta $%d liela atlīdzība, no spēlētāja %s [ID:%d].", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
return 1;
}
//BOUNTY------------------------------------------------------------------------
if(strcmp(cmd, "/bounty", true) == 0) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "{8FE11F}** {C8D1CC}/bounty [id]");
return 1;
}
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Uz %s [ID:%d] ir uzlikta $%d liela atlīdzība!", giveplayer,giveplayerid,bounty[giveplayerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
} else {
SendClientMessage(playerid, COLOR_GREY, "{ff0000}** {C8D1CC}Љads spēlētājs neeksistē!");
}
return 1;
}
//BOUNTIES----------------------------------------------------------------------
if(strcmp(cmd, "/bounties", true) == 0)
{
new x;
SendClientMessage(playerid, COLOR_GREEN, "Atlīdzību saraksts:");
for(new i=0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && bounty[i] > 0) {
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s%s[%d]: $%d", string,giveplayer,i,bounty[i]);
x++;
if(x > 3) {
SendClientMessage(playerid, COLOR_WHITE, string);
x = 0;
format(string, sizeof(string), "");
} else {
format(string, sizeof(string), "%s, ", string);
}
}
}
if(x <= 3 && x > 0) {
string[strlen(string)-2] = '.';
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
I thought that i can save that bountie stattus in file but its setting for giveplayerid but for saving its using playerid like
pawn Код:
SavePlayer(playerid)
{
dUserSetINT(PlayerName2(playerid)).("Jailed",PlayerInfo[playerid][Jailed]);
dUserSetINT(PlayerName2(playerid)).("JailTime",PlayerInfo[playerid][JailTime]);
dUserSetINT(PlayerName2(playerid)).("Muted",PlayerInfo[playerid][Muted]);
dUserSetINT(PlayerName2(playerid)).("MuteTime",PlayerInfo[playerid][MuteTime]);
dUserSetINT(PlayerName2(playerid)).("money",GetPlayerMoney(playerid));
dUserSetINT(PlayerName2(playerid)).("Bank",PlayerInfo[playerid][Bank]);
how to get that player disconnect he got his bounty saved?