SA-MP Forums Archive
Setting character spawn after making a character - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Setting character spawn after making a character (/showthread.php?tid=521567)



Setting character spawn after making a character - AMouldyLemon - 23.06.2014

I have this for multiple Spawn Point's:
pawn Код:
if(Character[playerid][SpawnPoint] == 1) //North Caravan Park
        {
            TogglePlayerSpectating(playerid, false);
            if(Character[playerid][ClothesUsed] == 1)
            {
                SetSpawnInfo(playerid, 0, Character[playerid][Clothes1], 765.9069,361.9311,20.8550,174.3097, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
               
                if(Character[playerid][Faction] == 1)
                {
                    SetPlayerArmour(playerid, 100);
                }
                if(Character[playerid][Faction] == 2)
                {
                    GivePlayerWeapon(playerid, 42, 99999);
                }
                SetPlayerArmedWeapon(playerid, 0);
            }
            else if(Character[playerid][ClothesUsed] == 2)
            {
                SetSpawnInfo(playerid, 0, Character[playerid][Clothes2], 765.9069,361.9311,20.8550,174.3097, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
               
                if(Character[playerid][Faction] == 1)
                {
                    SetPlayerArmour(playerid, 100);
                }
                if(Character[playerid][Faction] == 2)
                {
                    GivePlayerWeapon(playerid, 42, 99999);
                }
                SetPlayerArmedWeapon(playerid, 0);
            }
            else if(Character[playerid][ClothesUsed] == 3)
            {
                SetSpawnInfo(playerid, 0, Character[playerid][Clothes3], 765.9069,361.9311,20.8550,174.3097, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
               
                if(Character[playerid][Faction] == 1)
                {
                    SetPlayerArmour(playerid, 100);
                }
                if(Character[playerid][Faction] == 2)
                {
                    GivePlayerWeapon(playerid, 42, 99999);
                }
                if(Character[playerid][Faction] == 3)
                {
                    GivePlayerWeapon(playerid, 43, 20);
                }
                SetPlayerArmedWeapon(playerid, 0);
            }
        }
How do I add it to make them spawn at a specific location, after making a character.

I tried :
pawn Код:
SetSpawnInfo(playerid, 0, Character[playerid][Clothes1], Character[playerid][SpawnPoint] == 4, 0, 0, 0, 0, 0, 0);



Re: Setting character spawn after making a character - [WSF]ThA_Devil - 23.06.2014

Set spawn info and then set 100 - 200ms timer to spawn him. I assume you're in class selection at that point.
Within timer callback use SpawnPlayer(playerid);


Re: Setting character spawn after making a character - AMouldyLemon - 23.06.2014

SetSpawnInfo to what?


Re: Setting character spawn after making a character - [WSF]ThA_Devil - 23.06.2014

Both.
When account is created then set 100 ms timer, after which player will be spawned using SpawnPlayer(playerid);


Re: Setting character spawn after making a character - AMouldyLemon - 23.06.2014

This should work.. But no.

pawn Код:
new query[64];
                CreateCharacter(playerid, //2517
                GetPVarStringEx(playerid, "TEMP_C_NAME"),
                format(query, sizeof(query), "UPDATE `PlayerCharacter` WHERE `SpawnPoint` =%s", Character[playerid][SpawnPoint]);
               
                /*Settings[sDEFAULT_P_X],
                Settings[sDEFAULT_P_Y],
                Settings[sDEFAULT_P_Z],
                Settings[sDEFAULT_P_ANGLE],
                Settings[sDEFAULT_P_WORLD],
                Settings[sDEFAULT_P_INTERIOR],
                Settings[sDEFAULT_P_CASH],
                Settings[sDEFAULT_P_BANK],
                Settings[sDEFAULT_P_SKIN]);*/

                DeletePVar(playerid, "TEMP_C_NAME");
                ShowMenuDialog(playerid);

pawn Код:
MyProject.pwn(2526 -- 2528) : error 001: expected token: ",", but found ";"



Re: Setting character spawn after making a character - [WSF]ThA_Devil - 23.06.2014

seriously?
Код:
 CreateCharacter(playerid, //2517
                GetPVarStringEx(playerid, "TEMP_C_NAME"),
Why don't you finish your function, end it with semicollon and then try?


Re: Setting character spawn after making a character - AMouldyLemon - 23.06.2014

It's not that.