TorNix~|nR Posted March 29, 2017 Share Posted March 29, 2017 hello guys, I made a script of jail with my friend @WASSIm. that if player get a 3 stars goes automaticly in jail, but I lost it on my old camputer, so can anyone help me to make it please? Link to comment
itHyperoX Posted March 29, 2017 Share Posted March 29, 2017 (edited) so, if i'm right, you want that, when player wanted level change to 3, automaticly goin to jail. If yes, you can use setElementData -- Set the data when player wanted level change onElementDataChange -- you dont need setTimer setElementPosition -- Set the player position to jail setPlayerWantedLevel -- remove the wanted level I hope this help u. If i forgott something, or if you have some problems, feel free to ask here and we help ya Edited March 29, 2017 by TheMOG Link to comment
Pembo Posted March 29, 2017 Share Posted March 29, 2017 (edited) addEventHandler("onPlayerJoin", root, --for the purpose of this tutorial only, really you should use a saving system function() setElementData(source, "wantedLevel", 0) end ) function warpToJail(wantedLevel) if (getElementType(source) == "player") then if getElementData(source, wantedLevel) == 3 then setElementInterior(source, interior) --insert interior of jail setElementPosition(source, posX, posY, posZ) --insert position of jail setElementRotation(source, rotX, rotY, rotZ) --set the players rotation if need be outputChatBox("You have been sent to jail!", source, 255, 0, 0) --output a message to the player who was jailed end end end addEventHandler("onElementDataChange", root, warpToJail) Then you will need a system to add wanted levels to players and preferably a saving system to save the wanted level for each player. To accomplish this you should use MySQL or SQLite to save the players data into a table in a database every time they log out and retrieve it when they log back in. Edited March 30, 2017 by Pembo Link to comment
Gordon_G Posted April 1, 2017 Share Posted April 1, 2017 Pembo why are you sending a code, he asked for "help"... Link to comment
Anubhav Posted April 1, 2017 Share Posted April 1, 2017 Not to say the code is wrong. 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