Estevam2d Posted September 5, 2014 Share Posted September 5, 2014 (edited) I have a vehicle only for VIPs, but when a player who is also writing / vip my vehicle disappears; how can I solve this problem? how do I get the vehicle generate respawn again if I want the same? sorry my bad english Server: function VIPMENUTRIGGER ( thePlayer , commandName ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then triggerClientEvent ( thePlayer, "GUIVIP", thePlayer) destroyElement (criado) else outputChatBox ( "Voce nao e vip, para comprar fale com alguem da staff",thePlayer) end end addCommandHandler ( "vip", VIPMENUTRIGGER ) function vehiclecar (id) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local x,y,z = getElementPosition ( source ) criado = createVehicle ( id, x + 3, y, z + 1 ) warpPedIntoVehicle(source, criado) setElementModel(source, id) outputChatBox("[VIP] Veiculo criado",source,255,255,0,false) end end addEvent( "carr", true ) addEventHandler( "carr", getRootElement(),vehiclecar ) Edited September 5, 2014 by Guest Link to comment
Anubhav Posted September 5, 2014 Share Posted September 5, 2014 vip = {} function VIPMENUTRIGGER ( thePlayer , commandName ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then triggerClientEvent ( thePlayer, "GUIVIP", thePlayer) if isElement(vip[thePlayer]) then destroyElement (CRIADO) end else outputChatBox ( "Voce nao e vip, para comprar fale com alguem da staff",thePlayer) end end addCommandHandler ( "vip", VIPMENUTRIGGER ) function vehiclecar (id) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local x,y,z = getElementPosition ( source ) vip[source] = createVehicle ( id, x + 3, y, z + 1 ) warpPedIntoVehicle(source, criado) setElementModel(source, id) outputChatBox("[VIP] Veiculo criado",source,255,255,0,false) end end addEvent( "carr", true ) addEventHandler( "carr", getRootElement(),vehiclecar ) Link to comment
Estevam2d Posted September 5, 2014 Author Share Posted September 5, 2014 It did not work, some do not and neither he goes straight to the vehicle now. Link to comment
Castillo Posted September 5, 2014 Share Posted September 5, 2014 warpPedIntoVehicle(source, criado) Change 'criado' to vip [ source ] Link to comment
Estevam2d Posted September 5, 2014 Author Share Posted September 5, 2014 thanks but pq can spawn several cars? how do i spawn the same one I always wanting ? Link to comment
Estevam2d Posted September 5, 2014 Author Share Posted September 5, 2014 Thank you and Anubhav Solidsnake14 If it were not for you guys would be all wrong now, you guys are geniuses. vip = {} function VIPMENUTRIGGER ( thePlayer , commandName ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then triggerClientEvent ( thePlayer, "GUIVIP", thePlayer) if isElement(vip[thePlayer]) then destroyElement (vip[thePlayer]) end else outputChatBox ( "Voce nao e vip, para comprar fale com alguem da staff",thePlayer) end end addCommandHandler ( "vip", VIPMENUTRIGGER ) function vehiclecar (id) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local x,y,z = getElementPosition ( source ) vip[source] = createVehicle ( id, x + 3, y, z + 1 ) warpPedIntoVehicle(source, vip[source]) setElementModel(source, id) outputChatBox("[VIP] Veiculo criado",source,255,255,0,false) end end addEvent( "carr", true ) addEventHandler( "carr", getRootElement(),vehiclecar ) 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