Help with first spawn after registration & login
#1

Hello guys i done registration & login systems but i failed to find how to spawn and choose skins and how to get coordinates to make spanw position please

please give me the link of a tutorial please please

help me i am a noob in pawno i still learn it
Reply
#2

Goto a place ingame, stand in a place where you like it to be the class selection then type: /save myfirstclass

Now goto your Documents/GTA San Andreas User Files/SAMP/savedpositions.txt

You will find a player class line, you can use that with this function below:
AddPlayerClass

If you like to choose a skin of your own, check this: Skins: All

There are many ways to do this, but to get the basic idea its better you try these ways.
Reply
#3

To add spawns? It's simple.

pawn Код:
1st Step :

Go in a server, then use /save to save the location where the player will spawn.

2nd Step :

Open "Documents / GTA SA User Files / SAMP / savedpositions.txt"

3rd Step :

You should see a code with this format :

AddPlayerClass( 0, 999.0, 888.0, 777.0, 666.0, 0, 0, 0, 0, 0, 0 );

// Arguments : skinID, Float: spawnX, Float: spawnY, Float: spawnZ, Float: spawnAngle, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3.

4th Step :

Go to your script, then press CTRL + F.

5th Step :

Try to find "public OnGameModeInit"

6th Step :

Put the AddPlayerClass code below the OnGameModeInit thing. It will looks like below :

public OnGameModeInit( )
{
    AddPlayerClass( 0, 999.0, 888.0, 777.0, 666.0, 0, 0, 0, 0, 0, 0 );

    return 1;
}
Success, the player class was added, it's really simple and quick.

Then, to create camera position for the class selection :

pawn Код:
1st Step :

Go in game, then type /rs, it will save your position. Save the location where you want where the camera will be and where the player is located.

2nd Step :

Open "Documents / GTA SA User Files / SAMP / rawpositions.txt"

3rd Step :

You will see a coordinates like, "666.00, 777.00, 123.00, 513.00"

// Arguments : Float: X, Float: Y, Float: Z

4th Step :

public OnPlayerRequestClass( playerid, classid )
{
    SetPlayerPos( playerid, /* the first 3 positions */ ); // Where the player will be
    SetPlayerFacingAngle( playerid, /* the last position */ ); // The player's facing angle
    SetPlayerCameraPos( playerid, /* the first 3 camera positions */ ); // Where the camera will be
    SetPlayerCameraLookAt( playerid, /* the same location where the player is located */ ); // Where the camera will looks
 
    return 1;
}
Then you made your class selection.

To immediately spawn a player when they finish the registration or login

pawn Код:
forward spawn( playerid );
public spawn( playerid ) { return SpawnPlayer( playerid ), 1; }

CMD:login( playerid, params[ ] )
{
    // Your login code

    SetTimerEx( "spawn", 100, false, "i", playerid ); // Sets a timer

    return 1;
}

CMD:reg( playerid, params[ ] )
{
    // Your register code

    SetTimerEx( "spawn", 100, false, "i", playerid );  // Sets a timer

    return 1;
}
Then, you are done with it.

Also I don't really get what do you mean.

Give me a cookie if it helps It took some minutes to write
Reply
#4

everything is good thanks for helping but i failed with

public OnPlayerRequestClass( playerid, classid )
{
SetPlayerPos( playerid, /* the first 3 positions */ ); // Where the player will be
SetPlayerFacingAngle( playerid, /* the last position */ ); // The player's facing angle
SetPlayerCameraPos( playerid, /* the first 3 camera positions */ ); // Where the camera will be
SetPlayerCameraLookAt( playerid, /* the same location where the player is located */ ); // Where the camera will looks

return 1;
}

can you please tell me how to put the coordinates ?

i got those

1515.1830,-2286.4265,13.5469,89.3645 ;
1518.5729,-2280.0667,13.3828,273.1060 ;
1518.1439,-2279.8193,13.3828,87.9034 ;
1517.8352,-2279.8713,13.3828,99.5804 ;
1517.5284,-2279.9185,13.3828,98.7657 ;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)