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: odejmuje
1. Nie odejmuje pieniedzy
mam przelewy pieni?dzy, tylko ?e po przelewie pieni?dze dodaje, nie odejmuje
tzn

Przelewasz komu? - kto? dostaje, ci nie odejmuje
kod

[lua]
function onTransferMoney(plr, cmd, target, value)
local hajs = getElementData(plr,"player:money") or 0
if not target or not tonumber(value) then
outputChatBox('* U?yj: /przelej <nick/ID> <kwota>', plr)
return
end
value=string.match(value, "%d*")
value=tonumber(value)
local target=findPlayer(plr,target)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr)
return
end
if not (getElementData(target, "player:logged") == true) then
outputChatBox('* Gracz nie jest zalogowany!.', plr, 255, 0, 0)
return end
-- if getPlayerMoney(plr) < value then
if hajs < value then
outputChatBox("* Nie masz wystarczajacych ?rodk?w.", plr)
return
end
if value == 0 or value < 0 then
outputChatBox("* Poda?e?(a?) nie prawid?ow? warto??.", plr)
return
end
setElementData(plr, "player:money",hajs-tonumber(value))
setElementData(plr, "player:money",hajs+tonumber(value))

outputChatBox("* Przela?e?(a?) Pieni?dze graczowi: ["..getElementData(target,"id").."]"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." Ilo?? przelanej got?wki: "..value, plr, 245, 219, ...
2. Nie odejmuje gazu
Witaaam, mam problem z paliwem LPG. Po prostu gdy prze??cz? na LPG nie zabiera paliwa, mo?na zatankowa? ale nie odejmuje ilo?ci z baku gdy poruszamy sie pojazdem. Natomiast gdy prze??cz? na benzyn? kt?ra ma praktycznie taki sam kod jak gaz dzia?a bez zarzut?w.

c side
[lua]
--[[
Resource: OURGame
Developers: Split <[email protected]>
Copyright <[email protected]> 2015-2016
You have no right to use this code without my permission.
]]

-- Kod odpowiadaj?cy za odejmowanie paliwa oraz dodawanie paliwa
-- Wszelkie inne rzeczy s? w systemie vehicle?w // Split
local time=getTickCount()
local isBike={[509]=true,[481]=true,[510]=true}
local x1,y1,z1



local oX, oY, oZ
local function naliczaj(veh)
if(isPedInVehicle(localPlayer)) then
local pojazd = getPedOccupiedVehicle(localPlayer)
if getElementData(pojazd, 'vehicle:id') then
if getElementData(pojazd, "lpg:adaskOO") == false then return end

local x,y,z = getElementPosition(pojazd)
local thisTime = getDistanceBetweenPoints3D(x,y,z,oX,oY,oZ)
local dst = getElementData(pojazd, "vehicle:mileage") or 0
local dystans_add = thisTime
oX = x
oY = y
oZ = z
local przebiegAdd=dystans_add/100
local gazAdd=dystans_add/600
setElementData(pojazd, "vehicle:mileage", getElementData(pojazd, "vehicle:mileage")+przebiegAdd)
setElementData(pojazd,"gaz",getElementData(pojazd,"gaz")...
3. Nie odejmuje przedmiotu
Witam mam problem. Ustawi?em sobie przed funkcjami w skrypcie, ?eby mi nadawa?o elementDate na 5, no i gdy u?ywam przedmiotu to mi odejmuije i mam ilo?? przedmiotu r?wn? 4, ale gdy nast?pnym razem u?yje to ju? mi nie odejmuje -1 do ilo?ci.

ileziola getElementData(localPlayer"Marihuana")
wynik ileziola 1
guiGridListSetItemText
(gridrowmarychailosc""..wynik.." g."falsefalse)
4. Nie odejmuje kasy i nie dodaje zdrowia
setElementHealth source100)
setPlayerMoney sourcetonumber(money)-100 )
outputChatBox("Ta usluga kosztowala cie 100$. Uwazaj na siebie!"thePlayer


Komunikat jest a zdrowia nie dodaje jak i pieniedzy nie odejmuje :(
5. [INNE] Komenda nie odejmuje score
Witam mam tak? komend?:
[pawn]if(strcmp(cmd, "/mandat", true) == 0) {
new moneys;
new tmp369369[256];
new punktykr;
new punktykarne[256];
new giveplayerid;
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
tmp369369 = strtok(cmdtext, idx);
if(!strlen(tmp369369)) {
SendClientMessage(playerid, COLOR_WHITE, "*Wpisz: /mandat [playerid] [Pieni?dze] [Punkty]");
return 1;
}
giveplayerid = strval(tmp369369);
tmp369369 = strtok(cmdtext, idx);
if(!strlen(tmp369369)) {
SendClientMessage(playerid, COLOR_WHITE, "*Wpisz: /mandat [playerid] [Pieni?dze] [Punkty]");
return 1;
}
moneys = strval(tmp369369);
tmp369369 = strtok(cmdtext, idx);
if(moneys>50000){
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Maksymalna kwota mandatu mo?e wynie?? 50000$");
return 1;
}
punktykr = strval(tmp369369);
if(punktykr>15){
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Maksymalna ilo?? punkt?w karnych mo?e wynie?? 15");
return 1;
}
printf("Policjant %s da? graczu o id %d mandat w kwocie %d oraz %d pkt karnych",playername,giveplayerid,moneys,punktykr);
if (IsPlayerConnected(giveplayerid)) {
format(string, sizeof(string), "Dosta?e? mandat na %d$ pieni?dzy oraz %d punkt?w karnych od Policjanta %s (id: %d).", moneys, punktykr, playername);
SendClientMessage(giveplayerid, 0xFFFF00AA, string);
GivePlayerMoney(giveplayerid,-moneys);
punktykarne[giveplayerid]=punkt...