if(dialogid == DIALOG_PREMIUEVENT2) { if(DialogExploit(inputtext)) return SendClientMessage(playerid, COLOR_WHITE, "Ai folosit caractere nepermise in componenta noului tau nume."); new banipentruevent = strval(inputtext); if(MoneyACheck(playerid, banipentruevent, 1, 1000000)) return 1; if(GetPlayerCash(playerid) < banipentruevent) return SendClientMessage(playerid, COLOR_WHITE, "Tu nu ai suficienti bani."); if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid); else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid); else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer); else giveplayerid = GetPlayers(splayer); GivePlayerCash(playerid, -banipentruevent); GivePlayerCash(giveplayerid, banipentruevent); format(gString, sizeof(gString), "Organizatorul event-ului %s ia acordat premiu %d$ lui %s , pentru castigarea event-ului.",GetName(playerid), GetName(giveplayerid)); SendClientMessageToAll(COLOR_WHITE, gString); format(string, sizeof(string), "(!) {FFFFFF}%s (%d) a primit suma de banii trimisa de tine, motiv: castigatorul event-ului.", GetName(id), id); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "(!) {FFFFFF}%s (%d) ti-a oferit %d , motiv: castigarea event-ului.", GetName(playerid), playerid, banipentruevent); SendClientMessage(id, COLOR_WHITE, string); }
if(GetPlayerCash(playerid) < banipentruevent) return SendClientMessage(playerid, COLOR_WHITE, "Tu nu ai suficienti bani.");
stock GetPlayerCash(playerid) { return Cash[playerid]; }
stock GivePlayerCash(playerid, money) { Cash[playerid] += money; ResetMoneyBar(playerid); UpdateMoneyBar(playerid, Cash[playerid]); PlayerInfo[playerid][pCash] = Cash[playerid]; Update(playerid, pCashx); return Cash[playerid]; }
You're putting 1.000$ in the dialog box? |
GivePlayerCash(playerid, -banipentruevent); GivePlayerCash(giveplayerid, banipentruevent);
new debug_str[35];
format(debug_str, 35, "playerid = %d, giveplayerid = %d", playerid, giveplayerid);
SendClientMessage(playerid, -1, debug_str);
function GetPlayers(option[]) { new nrr = 0, id = 1002; if(IsNumeric(option)) { new i = strval(option); if(IsPlayerConnected(i)) id = i; else id = INVALID_PLAYER_ID; } else { foreach(new i : Player) { if(strfind(GetName(i), option, true) != -1) { nrr ++; } } if(nrr > 10) id = 1000; if(nrr == 0) id = INVALID_PLAYER_ID; if(nrr > 1 && nrr <= 10) id = 1001; foreach(new i : Player) { if(strfind(GetName(i), option, true) != -1 && id == 1002) { id = i; } } } return id; }