Czesc, ostatnio wykombinowa?em skrypt na fotoradar, niby wszystko jest ok, ale mandat wystawiany jest kazdemu, kto jedzie >50 km/h i nie znajduje si? w markerze. Za pomoc oczywi?cie stawiam piwsko
Chodzi o to ze gdy wpisze /mandat to Pokazuje sie na chat ze trzeba wpisac /mandat ID Kwota Powod wiec ok
Gdy jestem daleko od gracze to jest na chat ze jest daleko
Ale gdy Chce komus da? mandat to Nic sie nie dzeje tylko jest b??d w db
[lua]
function mandat33(plr, cmd, target, cash, ...)
if getElementData(plr,"player:duty") and getElementData(plr,"player:duty") == "SAPDLV" then
if not (target) or not (cash) or not (...) then
outputChatBox("B??d! U?yj: /mandat <nick/ID> <kwota> <pow?d>", plr)
else
if getElementData(plr,"player:rank") < 2 then outputChatBox("*Nie masz uprawnien",plr) return end
cash=tonumber(cash)
if cash <= 0 then
outputChatBox("B??d: Mandat Nie mo?e by? na minusie!", plr)
return
elseif cash > 32000 then
outputChatBox("B??d: Mandat Nie mo?e by? wi?kszy ni? 32,000PLN", plr)
return
end
local targetElement=exports['ogrpg-core']:findPlayer(plr, target)
if targetElement then
local x, y, z = getElementPosition(plr)
local tx, ty, tz = getElementPosition(targetElement)
local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
if (distance<=10) then
local reason=table.concat({...}, ' ')
local money=getPlayerMoney(targetElement)
local takeFromCash = money-cash
if money >= cash then
outputChatBox(&q...
Dzis jeszcze wszystko dza?a?o ale Tak godzine temu sie popsu?o (Nic nie by?o zmieniane)
Gdy wpisze /mandat Nic sie nie dzeje i jest B??d w db: Linika 5 I 31
[lua]
local adminresourceRoot = getResourceRootElement(getResourceFromName("dutyadmin22"))
function mandat(plr, cmd, target, cash, ...)
if getElementData(plr,"player:duty") and getElementData(plr,"player:duty") == "SAPDLV" then
if not (target) or not (cash) or not (...) then
plr:outputChat('B??d! U?yj: /mandat <nick/ID> <kwota> <pow?d>')
else
if getElementData(plr,"player:rank") < 2 then outputChatBox("*Nie masz uprawnien",plr) return end
cash=tonumber(cash)
if cash <= 0 then
plr:outputChat('Warto?? kwoty mandatu nie mo?e by? ujemna...')
return
elseif cash > 35000 then
plr:outputChat('Kwota mandatu jest zbyt du?a (max. 35.000 PLN).')
return
end
local targetElement=exports['ogrpg-core']:findPlayer(plr, target)
if targetElement then
local x, y, z = getElementPosition(plr)
local tx, ty, tz = getElementPosition(targetElement)
local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
if (distance<=10) then
local reason=table.concat({...}, ' ')
local money=getPlayerMoney(targetElement)
local takeFromCash = money-cash
if money >= cash then
plr:outputChat(('Wystawiono mandat dla %s, na kwot? %d PLN. Pow?d: %s...
Witam zacze?em pisa? skrypt na mandat, praktycznie sko?czy?em lecz jest b??d
Gdy wpisze /daj.mandat nick ilosc
To pisze ze gracza nie ma chociaz ze jest
Probuje zrobic mandat w gui tz, policjant wystawia mandat /mandat id kwota exp czas
i dla gracza pokazuje gui czy ma zaplacic kase i exp czy wybrac czas paki, lecz cos nie dziala po kliknieciu przyjmuje nic nie zabiera, a po kliknieciu wiezienie zawsze daje wiezienie na 0 min, jakby nie pobieralo wartsci... Prosze, oto moj kod:
[code]CMD:mandat(playerid, params[])
{
new idm, kasam, score, czasm;
if(gTeam[playerid] == TEAM_POLICJA)
{
if(sscanf(params, "dddd[64]", idm, kasam, score, czasm))
return SendClientMessage(playerid, COLOR_WHITE, "wpisz: /mandat [id] [kasa] [exp] [wiezienie]");
if(!IsPlayerConnected(idm))
return SendClientMessage(playerid, COLOR_RED, "Zle id!");
new dis;
new player;
dis = GetDistanceBetweenPlayers(playerid, player);
if(dis >= 8)
return SendClientMessage(playerid, CZERWONY, "Ten gracz jest zbyt daleko od Ciebie!");
else
{
new ss[256];
format(ss, sizeof(ss), "Policjant %s wystawil mandat w wysokosci %d$ i %d expnPrzyjmujesz mandat czy wybierasz wiezienie na %d min ?", PlayerName(playerid), kasam, score, czasm);
ShowPlayerDialog(idm, 1005, DIALOG_STYLE_MSGBOX, "Mandat",ss,"Przyjmuje","Wiezienie");
new id;
ZapiszGracza(id);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Nie masz dostepu do tej komendy");
}
return 1;
}[/code]
Otoz mam z tego forum kod mandatu od Jacob dzieki
wiec uzywam mta paradise i chce zrobic takie cos ze tej komendy moze uzywac tylko policja(team zrobiony)
oto kod:
I chce zeby dodac np jestem w poli i jak dam mandat To wyskakuje takie cos:
Wystawi?e? mandat graczowi (nick) a tej osobie ktorej zostal wystawiony mandat
Dosta?es mandat w wysokosci (kwota) od (nickpolicjanta) (powod mandatu)