Jump to content

Vehicle spawn vip


Estevam2d

Recommended Posts

Posted (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 by Guest
Posted
  
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 ) 
  

Posted
warpPedIntoVehicle(source, criado) 

Change 'criado' to

vip [ source ] 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thank you and Anubhav Solidsnake14

If it were not for you guys would be all wrong now, you guys are geniuses. :):P

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 ) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...