synix. Posted April 10, 2024 Posted April 10, 2024 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; } }
Xabi Posted April 11, 2024 Posted April 11, 2024 Where did you take that example from? It's all wrong. Use the official wiki: https://wiki.rage.mp/index.php?title=Main_Page
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now