JoZeFSvK Posted December 6, 2012 Share Posted December 6, 2012 Hey /flip work and !flip dont work why ? command ! i use on !fix and !nos and work and this ... function buyflip (source) rx, ry, rz = getPedRotation (source) x, y, z = getElementPosition (source) vehicle = getPedOccupiedVehicle (source) vehicler = getPedRotation (source) if ( isPedInVehicle ( source ) ) then local mapName = getMapName() if not (string.find (mapName,"DD")) then local cashHave = tonumber(loadPlayerData(source,"cash")) if (cashHave >= 500) then cashToTake = cashHave - 500 savePlayerData(source,"cash", cashToTake) outputChatBox("#007FFF[shop]#FFFFFF" ..getPlayerName(source).. "#FFFFFF has fliped his car for #007FFF500$. (/flip,!flip)", getRootElement(), 255, 255, 0, true) setVehicleRotation ( vehicle, 0, 0, vehicler, true ) scoreboardRefresh(source) else outputChatBox("#FF0000[shop]#FFFFFFYou need at least #FF0000500$#FFFFFF to buy flip.", source, 255, 0, 0, true) end else outputChatBox("#FF0000[shop]#FFFFFFYou can't upgrade your car in a #FF0000DD map!", source, 255, 0, 0, true) end else outputChatBox("#FF0000[shop]#FFFFFFYou've got to be #FF0000alive#FFFFFF to buy flip!", source, 255, 0, 0, true) end end addCommandHandler('bf', buyflip) addCommandHandler('flip', buyflip) ------------------------------------------------------- -- comand !flip ------------------------------------------------------- addEventHandler('onPlayerChat',root, function(msg,msgtype) if msgtype == 0 then if msg == "!flip" then executeCommandHandler("buyflip",source) end end end ) Link to comment
AhmadQTR Posted December 6, 2012 Share Posted December 6, 2012 cashToTake, savePlayerData, setVehicleRotation and scoreboardRefresh aren't functions use setElementRotation instead of setVehicleRotation Link to comment
JoZeFSvK Posted December 6, 2012 Author Share Posted December 6, 2012 comand work , my car fliped , but when i use !flip dont work Link to comment
AhmadQTR Posted December 6, 2012 Share Posted December 6, 2012 comand work , my car fliped , but when i use !flip dont work Try this addEventHandler('onPlayerChat',root, function(message, messageType) if messageType == 0 then if message == "!flip" then executeCommandHandler("buyflip",source) end end end ) PS : This is just for the second function which is !flip not the whole script. Link to comment
Guest Guest4401 Posted December 6, 2012 Share Posted December 6, 2012 The commands are bf and flip, but you execute buyflip. Link to comment
JoZeFSvK Posted December 6, 2012 Author Share Posted December 6, 2012 again /flip work and !flip dont work Link to comment
Guest Guest4401 Posted December 6, 2012 Share Posted December 6, 2012 again /flip work and !flip dont work Does /buyflip work? It doesn't. Do you know why? Because that command doesn't exist. addEventHandler('onPlayerChat',root, function(msg,msgtype) if msgtype == 0 then if msg == "!flip" then executeCommandHandler("flip",source) end end end ) Link to comment
JoZeFSvK Posted December 6, 2012 Author Share Posted December 6, 2012 why ? command dont work Link to comment
AhmadQTR Posted December 6, 2012 Share Posted December 6, 2012 why ? command dont work try addEventHandler('onPlayerChat',root, function(msg,msgtype) if msgtype == 0 then if msg == "!flip" then executeCommandHandler("bf",source) end end end ) Link to comment
Scripting Moderators Sarrum Posted December 6, 2012 Scripting Moderators Share Posted December 6, 2012 You need to give the resource access to executeCommandHandler in the acl.xml file. Link to comment
JoZeFSvK Posted December 6, 2012 Author Share Posted December 6, 2012 executeCommandHandler or ? Link to comment
AhmadQTR Posted December 6, 2012 Share Posted December 6, 2012 executeCommandHandler or ? No Link to comment
Guest Guest4401 Posted December 6, 2012 Share Posted December 6, 2012 addEventHandler('onPlayerChat',root, function(msg,msgtype) if msgtype == 0 then if msg == "!flip" then buyflip(source) end end end ) Link to comment
JoZeFSvK Posted December 6, 2012 Author Share Posted December 6, 2012 Thank you script work 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