^Dev-PoinT^ Posted October 2, 2011 Share Posted October 2, 2011 Hi all i have made War_System By onPlayerWasted Function See ClientSide ... outputChatBox("War_System|x[Dev-PoinT]x!",root,255,255,0) function xxx (ammo, killer, killerweapon, bodypart ) if (killer) and (killer ~= source ) then giveWeapon ( killer, 39, 2, true ) local sound = playSound("sounds/Siren.mp3") setSoundVolume(sound, 0.5) outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, watch out!", getRootElement(), 255, 255, 0) end end addEventHandler ("onPlayerWasted",getRootElement() , xxx) function outputWantedLevel () local wantedLvl = getPlayerWantedLevel ( ) if wantedLvl == 0 then outputChatBox ( "You clean", 0, 255, 0) else outputChatBox ( "You have "..wantedLvl.." Wanted stars!", 255, 0, 0) end end addEventHandler ( "onResourceStart", getRootElement(), outputWantedLevel ) ServerSide.... function xxx ( thePlayer ) setPlayerWantedLevel ( thePlayer, 3 ) outputChatBox ( getPlayerName ( thePlayer ) .. "is Wanted Kill him For Special weapons" ) end addEventHandler ("onPlayerWasted",getRootElement() , xxx) Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 (edited) addEventHandler ( "onResourceStart", getRootElement(), outputWantedLevel ) onResourceStart is this client?! addEventHandler ("onPlayerWasted",getRootElement() , xxx) onPlayerWasted is this client?! giveWeapon ( killer, 39, 2, true ) giveWeapon is this client?! ------------------------------------ outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, watch out!", getRootElement(), 255, 255, 0) also getRootElement() is only server side _-------------------------------------------_ local wantedLvl = getPlayerWantedLevel ( ) wtf is this? copy past example from wiki Edited October 2, 2011 by Guest Link to comment
^Dev-PoinT^ Posted October 2, 2011 Author Share Posted October 2, 2011 Please Fix it if you can i need it so bad Link to comment
Ignition Posted October 2, 2011 Share Posted October 2, 2011 Did you add the event with. addevent? Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 Did you add the event with. addevent? This function allows you to register a custom event. did you read wiki? I suggest you to read wiki before post anything https://wiki.multitheftauto.com/wiki/AddEvent addEvent is only for Custom events Link to comment
Ignition Posted October 2, 2011 Share Posted October 2, 2011 Did you add the event with. addevent? This function allows you to register a custom event. did you read wiki? I suggest you to read wiki before post anything https://wiki.multitheftauto.com/wiki/AddEvent addEvent is only for Custom events Sorry about that i misunderstood the script. Link to comment
Ignition Posted October 2, 2011 Share Posted October 2, 2011 (edited) Hope this works Try. this for the Client And see if it will work. outputChatBox("War_System|x[Dev-PoinT]x!",root,255,255,0) function xxx (ammo, killer, killerweapon, bodypart ) if (killer) and (killer ~= source ) then giveWeapon ( killer, 39, 2, true ) local sound = playSound("sounds/Siren.mp3") setSoundVolume(sound, 0.5) outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, watch out!", getRootElement(), 255, 255, 0) end end addEventHandler ("onClientPlayerWasted",getRootElement() , xxx) function outputWantedLevel () local wantedLvl = getPlayerWantedLevel ( ) if wantedLvl == 0 then outputChatBox ( "You clean", 0, 255, 0) else outputChatBox ( "You have "..wantedLvl.." Wanted stars!", 255, 0, 0) end end addEventHandler ( "onClientPlayerWasted", root, outputWantedLevel ) Edited October 2, 2011 by Guest Link to comment
Castillo Posted October 2, 2011 Share Posted October 2, 2011 (edited) Ignition, giveWeapon are server only functions. Edited October 2, 2011 by Guest Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 Solidsnake14, getPlayerWantedLevel can be Client and Server functions. Link to comment
Castillo Posted October 2, 2011 Share Posted October 2, 2011 Well, then I think the forum has to be updated, as the function color is YELLOW, it should be BLUE if was client & server function. Link to comment
Ignition Posted October 2, 2011 Share Posted October 2, 2011 Ignition, giveWeapon are server only functions. Solidsnake Could i try the triggerServerEvent function in place of giveWeapon and add the event giveWeapon Server side? if you get what i mean? Link to comment
Castillo Posted October 2, 2011 Share Posted October 2, 2011 You can use triggerServerEvent from client side and add it on server side to give the weapon. Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 i suggest to make the script from Server side and triggerClientEvent to playSound Link to comment
Castillo Posted October 2, 2011 Share Posted October 2, 2011 Yeah, that would be better, I agree. Link to comment
Ignition Posted October 2, 2011 Share Posted October 2, 2011 Alright i think I have it now. Still a bit new to scripting but i think i Have it now. Here, Client side outputChatBox("War_System|x[Dev-PoinT]x!",root,255,255,0) function xxx (ammo, killer, killerweapon, bodypart ) if (killer) and (killer ~= source ) then triggerServerEvent ( "giveWeapon", getLocalPlayer(thePlayer) local sound = playSound("sounds/Siren.mp3") setSoundVolume(sound, 0.5) outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, watch out!", getRootElement(), 255, 255, 0) end end addEventHandler ("onClientPlayerWasted",getRootElement() , xxx) function outputWantedLevel () local wantedLvl = getPlayerWantedLevel ( ) if wantedLvl == 0 then outputChatBox ( "You clean", 0, 255, 0) else outputChatBox ( "You have "..wantedLvl.." Wanted stars!", 255, 0, 0) end end addEventHandler ( "onClientPlayerWasted", root, outputWantedLevel ) Server side. addEvent ( "giveWeapon", true ) function givew (thePlayer) giveWeapon ( killer, 39, 2, true ) end Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 server side addEventHandler("onResourceStart",resourceRoot, outputChatBox("War_System|x[Dev-PoinT]x!",root,255,255,0) end) function xxx (ammo, killer, killerweapon, bodypart ) if (killer) and (killer ~= source ) then giveWeapon ( killer, 39, 2, true ) triggerClientEvent ( root, "StartSiren", root ) outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, watch out!", root, 255, 255, 0) end end addEventHandler ("onPlayerWasted", root, xxx) Client side function StartSound () local sound = playSound("sounds/Siren.mp3") setSoundVolume(sound, 0.5) end addEvent( "StartSiren", true ) addEventHandler( "StartSiren", root, StartSound ) function outputWantedLevel () local wantedLvl = getPlayerWantedLevel () if wantedLvl == 0 then outputChatBox ( "You clean", 0, 255, 0) else outputChatBox ( "You have "..wantedLvl.." Wanted stars!", 255, 0, 0) end end addEventHandler ( "onClientResourceStart", resourceRoot, outputWantedLevel ) Link to comment
^Dev-PoinT^ Posted October 3, 2011 Author Share Posted October 3, 2011 The Problem is if any Player died Play The Sound wtf who to Make it if Killer get the wapons Play The Siren and outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, Kill Him To Take His weapons!", getRootElement(), 255, 255, 0) and if the killer died make Pickup with His weapons iam new in script my knowing is 15% Link to comment
TAPL Posted October 3, 2011 Share Posted October 3, 2011 i know what you are trying to do and i can make it it's very easy but, this is not Request Forum Make it By YourSelf!!!!!!!!!!! start Learn and Stop Copy and Past From Wiki Link to comment
^Dev-PoinT^ Posted October 3, 2011 Author Share Posted October 3, 2011 Tapl if you great Script Help me or ..... i made 50 % From my script i have This Problem just this and you say dont copy form wiki when you enter the lua script you was noob in it and Now you great you start insult me? Link to comment
TAPL Posted October 3, 2011 Share Posted October 3, 2011 when i say for you (this is not Request forum) this mean i start insult you? wow this what you think? look up what i give you or what i fix for you you just put a random code and say fix my script your script fixed, now you need more thing, but did you try to make these things by yourself? answer: of course not, you just type your Request in forum without trying anything. Link to comment
^Dev-PoinT^ Posted October 3, 2011 Author Share Posted October 3, 2011 TAPL Sorrey For That and thx for fix i well try my self Thx Dude Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now