Jump to content

HELP ME PLEASE ;(


waqaarali

Recommended Posts

you like to make a rpg-server with now knowlage about events???

ok lets start

  
policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }   --[objectid]=policecar(true/false) if an object isn't listed its autamaticly false 
function getPlayerTeamPolice(player) 
     if policeVehicles[getElementModel(source)] 
         if getPlayerTeam(player) <> "police" then --if player team not police 
             cancleEvent() 
             outputChatBox("you are not an police man!") 
        end 
    end 
end 
  
addEventHandler ( "onVehicleStartEnter", getRootElement(), getPlayerTeamPolice ) 
  

that is a serverside script

watch next time the wiki!

you find also that on https://wiki.multitheftauto.com/wiki/On ... StartEnter

Link to comment
you like to make a rpg-server with now knowlage about events???

ok lets start

  
policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }   --[objectid]=policecar(true/false) if an object isn't listed its autamaticly false 
function getPlayerTeamPolice(player) 
     if policeVehicles[getElementModel(source)] 
         if getPlayerTeam(player) <> "police" then --if player team not police 
             cancleEvent() 
             outputChatBox("you are not an police man!") 
        end 
    end 
end 
  
addEventHandler ( "onVehicleStartEnter", getRootElement(), getPlayerTeamPolice ) 
  

that is a serverside script

watch next time the wiki!

you find also that on https://wiki.multitheftauto.com/wiki/On ... StartEnter

Your code is wrong, and you should use local variables instead.

Link to comment

-- Server Side! 
addEventHandler("onVehicleStartEnter",root, 
function (player) 
local model = getElementModel(source) 
 local team = getPlayerTeam ( player ) 
 local Name = ( team and getTeamName ( team )) 
    if ( Name ~= "Police Team Name" ) then 
  if ( model == 596 or model == 597  or model == 598 or model == 599 ) then 
cancelEvent() 
outputChatBox(" ** Police Vehicle's Only!",player,255,0,0,true) 
     end 
  end 
end 
) 
Link to comment

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...