Witam, posiadam taki kod po stronie serwera, chcia?bym abym m?g? leczy? gracza tylko w obr?bie kilku metr?w ( aby nie by?o sytuacji ze mozna leczyc gracza z drugiego konca mapy).
Potrzebuje jeszcze co? takiego, ?e je?li gracz jest zdrowy NIE mo?na go leczy? tzn. nie pobiera od niego pieniedzy i nie daje mu hp. Jak to zrobi? ?
addEvent("Ulecz", true) addEventHandler("Ulecz", root, function(gracz)
if not gracz then return end
setElementHealth(gracz, 100) takePlayerMoney(gracz, 50) givePlayerMoney(client, 50) outputChatBox("[POGOTOWIE] Zosta?e? uleczony przez lekarza. Op?ata pobrana.", gracz) outputChatBox("[POGOTOWIE] Uleczy?e? chorego, pacjent zap?aci? za leczenie.", client) end )
Rzecz jest w tym, ?e wysiadaj?c z auta ona przestaje dzia?a? i nie sprawdza kogo to pojazd tak jak powinna to robi?.
[lua]local sw,sh = guiGetScreenSize()
function onSuszarka(target)
if target then
if getElementType(target) == "vehicle" then
vehicle = target
end
end
end
addEventHandler ("onClientPlayerTarget", getRootElement(), onSuszarka)
function wlaczLPM()
render = true
end
bindKey ("mouse1", "down", wlaczLPM)
function wylaczLPM()
render = false
end
bindKey ("mouse1", "up", wylaczLPM)
function dxDrawSuszarkaInfo()
if render then
if vehicle then
if isElement(vehicle) then
--if getPlayerTeam(localPlayer) == getTeamFromName("Policja") then --zamiast Policja dowolna nazwa teamu, wazne by w cudzyslowiu (i taki team faktycznie istnial )
if getPedWeapon(localPlayer) == 22 then
local x, y, z = getElementPosition(localPlayer)
local tx, ty, tz = getElementPosition(vehicle)
local dis = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
local id = getElementData(vehicle, "car_id") or "Brak ID pojazdu"
local wl = getElementData(vehicle, "car_owner") or "Brak W?a?cicela"
if 80 >= dis then --jestesmy dosyc blisko gracza
local kmh = getVehicleSpeed(vehicle)
dxDrawRectangle(1115/1440*sw, 401/900*sh,...
else if(opcja==6)
{
tmp = strtok(cmdtext, idx);
if(isnull(tmp))
{
GuiInfo(playerid,""BIALY"U?yj: "ADMIN"/adom 6 (id domu)");
return 1;
}
new numer = strval(tmp);
if(DomInfo[numer][dAktywny]==true)
{
GetPlayerPos(playerid,DomInfo[numer][dWyjscieX],DomInfo[numer][dWyjscieY],DomInfo[numer][dWyjscieZ]);
DomInfo[numer][dWyjscieInt]=GetPlayerInterior(playerid);
DomInfo[numer][dWyjscieVir]=GetPlayerVirtualWorld(playerid);
GuiInfo(playerid,""MAPA"Zmieni?e? interior tego domu!");
return 1;
}
else
{
GuiInfo(playerid,""ADMIN"Nie poprawne id domu!");
}
return 1;
}
Niby wszystko jest prawie ok jednak komenda dzia?a?a gdy mia?em "bWyjscieVir" tyle ?e wstawia?a interior ale nie ustawia?o Wirtualnego ?wiata a r?cznie nie ma sensu ustawia?. W tej chwili mam errrora i prosi?bym o pomoc w naprawieniu.
D:r??neserverWPRL.pwn(46595) : error 017: undefined symbol "dWyjscieVir"