
BieHDC
Members-
Posts
296 -
Joined
-
Last visited
Everything posted by BieHDC
-
try to remove the siren check(if (getVehicleSirensOn ( theVehicle ) == true) then) and look what happens
-
why the bikeshop schould reload every 15 min?
-
Try this: edit: is this serverside? if its serverside you can prevent entering the vehicle with OnVehicleStartEnter and CancelEvent "https://wiki.multitheftauto.com/wiki/OnVehicleStartEnter" function bikeShop() lowriderBike = createVehicle(509, 698.6, -521.20, 16,0,0,225) setElementFrozen(lowriderBike,true) bmxBike = createVehicle(481, 695.6, -521.20, 16,0,0,225) setElementFrozen(bmxBike, true) mountainbikeBike = createVehicle(510, 692.6, -521.20, 16,0,0,225) setElementFrozen(mountainbikeBike,true) end addEventHandler("onResourceStart", getRootElement(), bikeShop)
-
you bind the function the the key with bindKey and if then the sirens are on(if veh has no it dont create) it creates the object
-
at first: victim2 is victim because i get my victim with getRandomPlayer() and if i use victim i get bad argument, but if i do victim2 = victim then it works isPedDead(victim) > bad argument isPedDead(victim2) > it works and i have victim global, so i think its a little bug which can be solved with this the secound: i have stored the hitter now as player, but i get bad argument @ getPlayerName line 21 lastHit = { } function whokilledvic ( thehitted ) local thehitter = source if (thehitter) ~= (victimvehicle) then if (thehitted) == (victimvehicle) then thelastone = getVehicleOccupant(thehitter) lastHit [ thehitted ] = thelastone outputChatBox( " Data Stored! ", root ) end end end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic ) function isthevictimkilled() if isElement( victim2 ) then if ( isPedDead ( victim2 ) ) then local lastHitter = lastHit [ source ] local hittername = getPlayerName(lastHitter) --here is the bad argument outputChatBox(" The last hitter was " ..hittername , root ) end end end addEventHandler ( "onPlayerWasted", root, isthevictimkilled )
-
have you also skype? and thx^ and if you have ideas what i can built in, then tell me^
-
ok that will work maybe EDIT: i have done something wrong? line 20: bad argument @ getVehicleOccupant Edit2: why not use getPlayerSerial and getPlayerFromSerial? lastHit = { } function whokilledvic ( thehitted ) local thehitter = source if (thehitter) ~= (victimvehicle) then if (thehitted) == (victimvehicle) then lastHit [ thehitted ] = thehitter outputChatBox( " Data Stored! ", root ) --i get this check output end end end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic ) function isthevictimkilled() if isElement( victim2 ) then if ( isPedDead ( victim2 ) ) then lastHitter = lastHit [ source ] hittername = getPlayerName(getVehicleOccupant(lastHitter)) --bad argument @ getVehicleOccupant outputChatBox(" The last hitter was " ..hittername , root ) end end end addEventHandler ( "onPlayerWasted", root, isthevictimkilled )
-
thx for the "better" code^ EDIT: it works its a special DD, a revolution One is Victim and the others have to catch him. If the victim hits a colsphere he wins and so on... And yes its long, but what would be the right...if 1 sec then its flooding > think about if 20 players are messing around with one victim and if the script is ready i will post in showcase and maybe you wanna develop with me if you think its a good one^ because i wrote it in noob style, because i am a beginner and i would need someone who can help me to unmess the code
-
sorry i am not so experienced with tables yet can you pls write how to store and how to get?
-
maybe i should post the script the server recives the data from client! No NIL or fails > TESTED function whokilledvic ( thehitted ) local thehitter = source if (thehitter) ~= (victimvehicle) then --if the hitter is not the victim if (thehitted) == (victimvehicle) then --if the hitted vehicle is the victim --Here should be the data saved set lastest hitter = getVehicleOccupant(thehitter) --the clientside sends the vehicle not the player end end end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic ) function isthevictimkilled() if isElement( victim2 ) then if ( isPedDead ( victim2 ) ) then --get the lastest hitter end end end addEventHandler ( "onPlayerWasted", root, isthevictimkilled )
-
i already noticed that and have done the following: and it works function collision ( thehitted ) if hit == "false" then if thehitted and getElementType ( thehitted ) == "vehicle" then if ( source == getPedOccupiedVehicle(getLocalPlayer()) ) then thehitted2 = thehitted triggerServerEvent ( "whowasit", source, thehitted2 ) hit = "true" setTimer( resethittimer, 5000, 1 ) end end end end addEventHandler("onClientVehicleCollision", root, collision) function resethittimer() hit = "false" end
-
Hello, i would like to know what would be the best way to store a element(player), that changes often? i describe you what i mean: If somebody hitted a specific player (in my case the victim), he should be stored as last hitter. If in some secounds another player hitted the "victim" then he should be stored as last hitter, until the victim is wasted. and then the last hitter get some money. I dont want you to script for me, i only wanna know what i should use. Maybe SERIAL, or PlayerName(may cause problems with getting him later again i think), or what ever... What would be the best function?
-
thx now it works and i gained a bit more experience ^
-
server line 74 > use addEventHandler("onVehicleStartExit", rootElement, giveMoney) instead of addEventHandler("onVehicleExit", rootElement, giveMoney) tell me then if it works
-
Hello, i wanna give the Server 2 elements, but only the 1st is sent sucsessfully. Outputs: server line 4 > bad argument @ getvehicleaccupant --clientside function collision ( thehitted ) if thehitted and getElementType ( thehitted ) == "vehicle" then if ( source == getPedOccupiedVehicle(getLocalPlayer()) ) then triggerServerEvent ( "whowasit", source, thehitted ) end end end addEventHandler("onClientVehicleCollision", root, collision) --serverside function whokilledvic ( thehitter, thehitted ) local hitterp = getPlayerName(getVehicleOccupant( thehitter )) local hittedp = getPlayerName(getVehicleOccupant( thehitted )) setVehicleColor ( thehitter , 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255 ) outputChatBox( hitterp.. " > hitted > " ..hittedp, root ) end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic )
-
thats why we need the output here so pls post it that we can help you better ok? if you dont know how to, get admin on the server and write in chatbox: /debugscript 3 or press F8 and write debugscript 3 and enter
-
but mine worked because i got the trigger to the server -.- you said source is vehicle and getPedOccupiedVehicle returns theVehicle! so my code it right! yours is false because the source is already the vehicle you messed up getVehicleOccupant ( needs the vehicle and returns player) and getPedOccupiedVehicle (needs player and returns Vehicle) ok? my problem is only that the two player names are not sucsessfully sent to server > thats the only thing i cant manage
-
post the debugscript outputs too please
-
hello, i know that we cant "send" Elements to server with triggerServerEvent, so i was looking for a workaround with getPlayerName and getPlayerFromName, but it wont work Here is my code, maybe you find the fail. This is only a "try-out" example with no sense: --clientside function collision ( thehitted ) if thehitted and getElementType ( thehitted ) == "vehicle" then if ( source == getPedOccupiedVehicle(getLocalPlayer()) ) then thehittername = getPlayerName(getLocalPlayer()) thehittedname = getPlayerName(getVehicleOccupant(thehitted)) triggerServerEvent ( "whowasit", root, thehittername, thehittedname ) end end end addEventHandler("onClientVehicleCollision", root, collision) --serverside function whokilledvic ( thehittername, thehittedname ) local hitterp = getPlayerFromName( thehittername ) local hittedp = getPlayerFromName( thehittedname ) outputChatBox( hitterp.. " > hitted > " ..hittedp , root ) end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic )
-
hmmm doesnt work like i want to (no scripting error) i need it for a special thing, so i will try use getDistanceBetweenPoints3D and onVehicleDamage
-
thx man i know i have seen such event in past but couldnt find it anymore and maybe you can give me a little example of my idea^ (already have read the examples in wiki, but they not matching mine and i am a beginner scripter so pls )
-
or if you prefer gui then go into adminpanel > Resources and down there is a text input type in there "setDevelopmentMode(true)" without "" and then press F8 and type "showcol" wo ""
-
Hello, i wanna make something that detects which player(vehicle) has hit the other player(vehicle). So if the one hit the other and the hitted got killed within 10 sec the other recives something. I dont want you to make me this script! I wanna know what would be the best Functions and Events to use. I thought about attaching a colsphere to the vehicle and on hit to check. And would be serverside or clientside better. (i think serverside ) thx if you can help me a bit, if not then not
-
I use Geany, because i am working always on Linux Mint 15 and also play MTA there for Linux users here, this will be the best, tryed about 10 editors ;D