Jump to content

player_spawn Script


synix.

Recommended Posts

Hello, i try to start with development in RAGEMP ( GTA 5 )

i made a Script. But 

API.onPlayerConnected += OnPlayerConnected;


Error CS1061: "API" does not contain a definition for "onPlayerConnected" and no accessible onPlayerConnected extension method could be found that takes a first argument of type "API" (possibly a missing using directive or assembly reference).

how can i fix it ?

 

using GTANetworkAPI;
using System;
public class PlayerSpawn : Script
{
    
    private readonly Vector3 spawnPosition = new Vector3(0, 0, 72);

    public PlayerSpawn()
    {
        
        API.onPlayerConnected += OnPlayerConnected;
    }

    private void OnPlayerConnected(Player player)
    {
        
        player.Position = spawnPosition;
    }
}

 

Link to comment
Share on other sites

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