Jump to content

Help ...


iPrestege

Recommended Posts

function Grove ( source ) 
     local team = getTeamName ( source ) 
    local Grove = getPlayerTeam ( source )           
    if ( Grove ) then                              
      spawnPlayer (source, x,y,z Grove) 
           
         end 
   end 
addEventHandler ( "onPlayerWasted", getRootElement(), Grove ) 

Right ?

Link to comment
function Grove ( source ) 
     local team = getTeamName ( source ) 
    local Grove = getPlayerTeam ( source )           
    if ( Grove ) then                              
      spawnPlayer (source, x,y,z Grove) 
           
         end 
   end 
addEventHandler ( "onPlayerWasted", getRootElement(), Grove ) 

Right ?

No, you have three errors:

1. There's no "source" parameter, source is a predefined variable in the function and it points to the player who died.

2. You didn't check the team name and the "team" and "Grove" variables make totally no sense.

3. Where is "x", "y" and "z" defined? And what's that "Grove" after "z"?

Link to comment
function Grove ( source ) 
     local team = getTeamName ( source ) 
    local Grove = getPlayerTeam ( source )           
    if ( Grove ) then                              
      spawnPlayer (source, x,y,z Grove) 
           
         end 
   end 
addEventHandler ( "onPlayerWasted", getRootElement(), Grove ) 

Right ?

No, you have three errors:

1. There's no "source" parameter, source is a predefined variable in the function and it points to the player who died.

2. You didn't check the team name and the "team" and "Grove" variables make totally no sense.

3. Where is "x", "y" and "z" defined? And what's that "Grove" after "z"?

1- i read the wiki quick ..

2- i will fix it

3- i saw the example in the wiki like that -_-" And grove = My Team

..

Link to comment
function Grove ( source ) 
     local team = getTeamName ( source ) 
    local Grove = getPlayerTeam ( source )           
    if ( Grove ) then                              
      spawnPlayer (source, x,y,z Grove) 
           
         end 
   end 
addEventHandler ( "onPlayerWasted", getRootElement(), Grove ) 

Right ?

No, you have three errors:

1. There's no "source" parameter, source is a predefined variable in the function and it points to the player who died.

2. You didn't check the team name and the "team" and "Grove" variables make totally no sense.

3. Where is "x", "y" and "z" defined? And what's that "Grove" after "z"?

1- i read the wiki quick ..

2- i will fix it

3- i saw the example in the wiki like that -_-" And grove = My Team

..

About the 3 - You forgot the "," then.

The code should be like this:

local g_szTeam = "YOUR_TEAM_NAME"; 
local g_pPosition = { 0, 0, 0 }; 
      
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        local pTeam = getPlayerTeam( source ); 
        if ( pTeam and getTeamName( pTeam ) == g_szTeam ) then 
            spawnPlayer( source, unpack( g_pPosition ) ); 
            setPlayerTeam( source, pTeam ); 
        end 
    end 
) 

Edited by Guest
Link to comment

But there is a problem! i use Play GameMode but when a player Wasted player goes into pos in the code, but go to the exact location in the Play GameMode also .

i add some code to anderl code :

local g_szTeam = "Police"; 
local g_pPosition = { -1858.80212, -1612.50281, 21.76415 }; 
      
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        local pTeam = getPlayerTeam( source ); 
        if ( pTeam and getTeamName( pTeam ) == g_szTeam ) then 
            spawnPlayer( source, unpack( g_pPosition ) ); 
            setPlayerTeam( source, pTeam ); 
           giveWeapon ( source , 16, 1 ) 
           giveWeapon ( source , 31, 100 ) 
           giveWeapon ( source , 24, 100 )   
           setPedSkin ( source, 285 ) 
        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...