Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: /przelew
1. /przelew
odrazu m?wie skrypt nie jest m?j ale chcia? bym oczekuje pomocy chcia? bym zrobic komend? na /przelew ale niestety nie do ko?ca mi to wychodzi
kod:
[lua]addCommandHandler ( "przelew",
function ( player, cmd, nick, kwota )
if nick and kwota then
local aplayer = getPlayerFromName ( nick )

if aplayer then
kwota = tonumber(kwota)
if kwota <= getPlayerMoney ( player ) and kwota > 0 then
takePlayerBankMoney ( player, kwota )
givePlayerBankMoney ( aplayer, kwota )
outputChatBox ("Wys?a?e? " ..kwota.. " $ graczowi " ..nick, player, 255,50, 50 )
outputChatBox ("Dosta?e? " ..kwota.. " $ od gracza" ..player, aplayer, 255,50, 50 )
else
outputChatBox ( "Nie masz tyle pieni?dzy lub podana kwota jest nieprawid?owa!", player, 255,50, 50 )
end
else
outputChatBox ( "Nie ma takiego gracza na serwerze!", player, 255,50, 50 )
end
else
outputChatBox ( "U?yj /przelew [nick] [kwota]", player, 255, 50, 50 )
end
exports["pystories-db"]:dbSet("UPDATE `pystories_users` SET `bank_money` = `bank_money` - ? WHERE `pystories_users`.`id` = ?", cost, getElementData(plr, "player:sid"))
end
)[/lua]

[b][color=#990000]Stosuj znaczniki [.lua]KOD[/lua] ;) //Emm[/color][...
2. /przelew
Witam, chcia?bym zrobi? skrypt na przelew tzn przelew bankowy..

Chodzi mi o to ?e po wpisaniu np /przelew [sid danego gracza] [kwota] zabiera nam dan? kwote z bankomatu i dodaje j? tej osobie. kto? by pomog??

zrobi?em co? takiego ale jak zwykle nie dzia?a

[code]function onTransferMoney(plr, cmd, target, value)
if not data then return end
local bankmoney = exports["pystories-db"]:dbGet("SELECT `bank_money` FROM `pystories_users` WHERE `id` = ?", getElementData(plr, "player:sid"))
for i, v in ipairs(bankmoney) do
plrmoney[plr] = v["bank_money"]
end

if not target or not tonumber(value) then
triggerClientEvent(plr, "createNotif",plr,"/dajkase nick kwota",3,"info")
return
end
value=string.match(value, "%d*")
value=tonumber(value)
local target=findPlayer(plr,target)
if not target then
triggerClientEvent(plr, "createNotif",plr,"Nie znaleziono gracza",1,"error")
return
end
if not (getElementData(target, "player:logged") == true) then
outputChatBox('* Gracz nie jest zalogowany!.', plr, 255, 0, 0)
return end
if plrmoney[plr] < value then
triggerClientEvent(plr, "createNotif",plr,"Nie masz tyle pieni?™dzy",1,"error")
return
end
if value == 0 or value < 0 then
triggerClientEvent(plr, "createNotif&qu...