-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
rankingboard
-
скорее всего он скомпилирован.
-
"spaces" (or tabs) is "indentation": http://en.wikipedia.org/wiki/Indent_style as for «end», it is used to close functions/statements (if, for, while, etc.). you should read about programming/scripting in general.
-
1. you have player defined and then use hitElement (which is nil) 2. you should check if element that hit the marker is a player at all 3. you've lost all "end"s somewhere 4. didn't add the function to handle your onMarkerHit event 5. marker is called "myMarker" but you're sticking an event to "theMarker" myMarker = createMarker ( -3456, 1555, 2, 'cylinder', 100.0, 225, 0, 0, 0 ) function markerHit(hitElement) -- 1 if getElementType(hitElement) ~= "player" then return false end -- 1,2 local theAccount = getPlayerAccount(hitElement) -- 1 if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) then outputChatBox("** You have entered the admin base **", hitElement, 255, 0, 0) else killPlayer(hitElement) end -- 3 end -- 3 end -- 3 addEventHandler("onMarkerHit", myMarker, markerHit) -- 4,5
-
i'm not saying it's impossible, it's just crazy
-
this feature is not in the bigradar resource currently (map is too big, more than 1MB). hm, where did you see a rectangular radar anyway? are you sure you're not confusing radar with radar area? if you want rounded radar area, then there's nothin can be done, it's rectangular. well maybe something can be done by using some colshapes and making custom displayed circular radar areas (or not, since there's no circles anywhere), but i think it's not worth it.
-
i made this once in my «bigradar» resource (with zoom and all that): since dxDrawImage/Section only draws rectangular stuff, im totally supporting the dx image «masking» suggestion. also, the map for that radar will be huge (if you want decent radar map quality), mine used 6000x6000 map for fullscreen radar and 2048x2048 for a small hud one, and still it was crappy when zoomed in. imo, it is not worth it right now.
-
К сожалению я не понял - я вообще онлайн сервер впервые пытаюсь сделать - я не знаю вообще как и че - тупо залил папку сервера вместе с файлами на народ. З.Ы. Народ гад такой удалил DLLки и ЕХЕшник) что нить другое поищу веб-хостинг для этого дела не подойдет, на то он и веб-хостинг.
-
create simple dxDrawText below with the same text, and check if your name even contains color.
-
function(player,name): and how do you plan to get player and name from onClientRender event? use getPlayerName(getLocalPlayer()) (and you dont need to do it every frame) but since you're stripping color tags, you dont need dxDrawColorText function anyway.
-
what is getPlayerName() at line 22? it need player element. right now it returns false. debug window pretty much shows all you need to fix this.
-
the whole script wouldnt be an example already.
-
i dont really get what are you trying to do (get player's vehicle and then destroy some other unrelated vehicle by it's ID?), but: 1. first argument to command handler function is player element (im assuming this is serverside script) so hacker(player, commandName, name) 2. you cant getPedOccupiedVehicle from name string, you need to get player element first, using getPlayerFromName(name) 3. modelID is not set anywhere in this function, is it outside? 4. setElementPosition, not setElementPostion (also needs player element, not name, which is a string) 5. outputChatBox also needs player element
-
well because line breaks are not supported there. that is what needs to be done
-
actually i've figured that out, and tried to subtract and all that, but it didnt work out as i recall. also: http://bugs.mtasa.com/view.php?id=5854 well it's enough to calculate from size of the resulting dx text and bounding box size. something like this: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end test:
-
second parameter here is not the amount of characters, it is ending position. this way it'll output only "h" and nothing after it.
-
local test = "hello" for i=1, #test do outputChatBox(test:sub(i, i)) end
-
local test = "hello" print(test:sub(4, 4))
-
bright as in what? setVehicleColor
-
are you sure that "account" is an account? i mean, maybe you forgot something like "local account = getPlayerAccount(source)"
-
if ( weapon == 3 ) then -- It's not If, it's if, with lowercase. if (team==swat or team==fbi or team==officer or team==tc) then local stars = getPlayerWantedLevel ( source ) --[[>]] local time = stars*10 -- time =, not time - --[[>]] setAccountData(account, "rpg.jtime", time) -- is account variable set? setTimer(free,time*1000,1,source) end end end function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerstars = getPlayerWantedLevel ( source ) setAccountData ( playeraccount, "rpg.wstars", playerstars ) end end function onPlayerLogin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerstars = getAccountData ( playeraccount, "rpg.wstars" ) if ( playerstars ) then setPlayerWantedLevel ( source, playerstars ) end end end function registeracc( playerSource, commandName, user, pass ) local account = getPlayerAccount ( playerSource ) if isGuestAccount ( account ) then --[[>]] if getAccount( user ) then -- same thing with if, not If, also 'then' was missing outputChatBox ( "Account name already exists.", playerSource ) else addAccount( user, pass ) ` outputChatBox ( "Account " ..user.. " successfully created with password " ..pass.. ".", playerSource ) end else outputChatBox ( "You already have account.", playerSource ) end end addCommandHandler ( "register", registeracc ) addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage ) addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
