Jump to content

طلب اكواد +مساعده [police Job]


Tarek1

Recommended Posts

ألسلام عليكم 

  Job Rankفي خانه   Trianer ويتم كتابه   Job في خانه Police Officer   يتم كتابه accept فكره السكربت : عندما يضغط الاعب علي زر 

 

http://imgur.com/a/s7B8U

 

http://imgur.com/a/yCDNz

 

-- Server Side

call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "Job" )
call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "Job Rank" )
aTeam = createTeam ( "Police" , 100, 149, 237 )
setTeamFriendlyFire ( aTeam,true )

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , 
	function ( )
	 if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then 
		 return
		  outputChatBox ("* you have this team",source,255,0,0,true) 
		end
			  setPlayerTeam ( source ,aTeam )
			  setElementModel (source,280)
			  giveWeapon ( source, 3, 1 )
			  giveWeapon ( source, 23, 200 )
			  outputChatBox ( 'Now You Are in police job!',source,0,255,0 )
			  setElementData ( player , "Job" , "Police Officer" )
                          setElementData ( player , "Job Rank" , "Trainer" )
	end 
)
--Client Side

call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "Job" )
call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "Job Rank" )
aTeam = createTeam ( "Police" , 100, 149, 237 )
setTeamFriendlyFire ( aTeam,true )

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , 
	function ( )
	 if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then 
		 return
		  outputChatBox ("* you have this team",source,255,0,0,true) 
		end
			  setPlayerTeam ( source ,aTeam )
			  setElementModel (source,280)
			  giveWeapon ( source, 3, 1 )
			  giveWeapon ( source, 23, 200 )
			  outputChatBox ( 'Now You Are in police job!',source,0,255,0 )
			  setElementData ( player , "Job" , "Police Officer" )
                          setElementData ( player , "Job Rank" , "Trainer" )
	end 
)

 

 

 

Link to comment
1 minute ago, N3xT said:

وين الكلنت سايد ؟


addEventHandler ( "onClientGUIClick" , root , function ( )
if ( source == btn1 ) then 
guiSetVisible ( wpolice , false )
showCursor ( false )
guiSetInputEnabled ( false )
triggerServerEvent ( "JoinPolice" , localPlayer ) 

Link to comment

Client : 

addEventHandler ( "onClientGUIClick" , root , function ( )
	if ( source == btn1 ) then 
		guiSetVisible ( wpolice , false )
		showCursor ( false )
		guiSetInputEnabled ( false )
		triggerServerEvent ( "JoinPolice" , localPlayer, localPlayer ) 
	end
end	)

 

Server : 

addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , 
	function ( player )
		if ( getPlayerTeam ( player ) and getPlayerTeam ( player ) == aTeam ) then 
			return
			outputChatBox ("* you have this team",player,255,0,0,true) 
		end
		setPlayerTeam ( player ,aTeam )
		setElementModel (player,280)
		giveWeapon ( player, 3, 1 )
		giveWeapon ( player, 23, 200 )
		outputChatBox ( 'Now You Are in police job!',player,0,255,0 )
		setElementData ( player , "Job" , "Police Officer" )
        setElementData ( player , "Job Rank" , "Trainer" )
	end 
)

 

Edited by N3xT
Link to comment
13 minutes ago, N3xT said:

Client : 


addEventHandler ( "onClientGUIClick" , root , function ( )
	if ( source == btn1 ) then 
		guiSetVisible ( wpolice , false )
		showCursor ( false )
		guiSetInputEnabled ( false )
		triggerServerEvent ( "JoinPolice" , localPlayer, localPlayer ) 
	end
end	)

 

Server : 


addEvent("JoinPolice",true)
addEventHandler("JoinPolice",root , 
	function ( player )
		if ( getPlayerTeam ( player ) and getPlayerTeam ( player ) == aTeam ) then 
			return
			outputChatBox ("* you have this team",player,255,0,0,true) 
		end
		setPlayerTeam ( player ,aTeam )
		setElementModel (player,280)
		giveWeapon ( player, 3, 1 )
		giveWeapon ( player, 23, 200 )
		outputChatBox ( 'Now You Are in police job!',player,0,255,0 )
		setElementData ( player , "Job" , "Police Officer" )
        setElementData ( player , "Job Rank" , "Trainer" )
	end 
)

 

شكرا  <3 :)

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