Čau, chcel by som sa ťa opýtat o ten navod čo si robil na tvojom fore (posielal som ti to na skype ale bol si asi zaneprazdneni tak ti to pisem tu)
mam panel a chcel by som tam pridat ten fix , ale cez get player money to nejde lebo ten script uklada do vlastnej zlozky database.xml , no nasiel som tam v tom scripte pri kupovani mapy playerCash , snazil som sa to nahradit namiesto get player cash ale vypisalo error ze funkcia nevyhodila ziadnu hodnotu, pravdepodobne neexistuje
alebo ne tak sa zapisuje alebo neni definovana ale syntax sedi vyzeralo to asi takto
po uprave
Code:
function oprava (player, command)
if (getPlayerMoney(player) < 1500) then --Jestli ma hrac vice jak 1500..
local auto = getPedOccupiedVehicle(player) --Nadefinuje auto ("element") k oprave
fixVehicle(auto) --samotna oprava
setPlayerMoney(player, playerCash(player) - 1500 ) --Odecte mu $1500
outputChatBox("Nechal jsi si opravit auto za $1500! Tvuj zustatek na uctu cini $" .. playerCash(player), player, 250, 0, 0) --Vypise cervenou zpravu se zustatkem na uctu.
else --Pokud ma min jak 1500..
outputChatBox("Nemas dost prasuli, potrebujes $1500!", player, 250, 0, 0 )
end --Konec podminky
end --konec funkce
addCommandHandler("fixniAuto", oprava) --Prida prikaz /fixniAuto
player cash tam nesedi , no neviem , dedukoval som to z casti "prevod penazi" give money ktora vyzerala asi takto ,
(davam pre pripad ak by nieco pomohlo pre napady)
Code:
function giveMoney(thePlayer,CMD,targetPlayer,amount)
if not (targetPlayer == "") then
if tonumber(amount) then
local playerCash = tonumber(loadPlayerData(thePlayer,"cash"))
if tonumber(amount) > 0 then
if tonumber(amount) <= playerCash then
if (findPlayerByName(targetPlayer)) then
local target = findPlayerByName(targetPlayer)
if target ~= thePlayer then
local amount = math.ceil(amount)
local playerCash = loadPlayerData(thePlayer,"cash")
local targetCash = loadPlayerData(target,"cash")
savePlayerData(thePlayer,"cash",playerCash-tonumber(amount))
CheckAchievement(thePlayer,15)
savePlayerData(target,"cash",targetCash+tonumber(amount))
CheckAchievement(target,15)
local playerCash = loadPlayerData(thePlayer,"cash")
local targetCash = loadPlayerData(target,"cash")
scoreboardRefresh(thePlayer)
scoreboardRefresh(target)
outputChatBox("#00AAFF# #FFFFFFYou have sent #00AAFF$"..amount.."#FFFFFF to "..getPlayerName(target).."#FFFFFF!",thePlayer,255,255,255,true)
outputChatBox("#00AAFF# #FFFFFF"..getPlayerName(thePlayer).." #FFFFFFhas sent you #00AAFF$"..amount.."#FFFFFF!",target,255,255,255,true)
else
outputChatBox("#00AAFF# #FFFFFFERROR! You cannot send money to yourself!",thePlayer,255,255,255,true)
return false
end
else
outputChatBox("#00AAFF# #FFFFFFERROR! The player you specified does not exist!",thePlayer,255,255,255,true)
return false
end
else
outputChatBox("#00AAFF# #FFFFFFERROR! You don't have enough money!",thePlayer,255,255,255,true)
return false
end
else
outputChatBox("#00AAFF# #FFFFFFERROR! Invalid amount! [#00AAFF"..amount.."#FFFFFF]",thePlayer,255,255,255,true)
return false
end
else
outputChatBox("#00AAFF# #FFFFFFERROR! Please specify the amount to send!",thePlayer,255,255,255,true)
return false
end
else
outputChatBox("#00AAFF# #FFFFFFERROR! Please select a player!",thePlayer,255,255,255,true)
return false
end
end
addCommandHandler("givecash", giveMoney)