SA-MP Forums Archive
How to make spawn? - 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: How to make spawn? (/showthread.php?tid=428141)



How to make spawn? (Problem) - Igi_Guduric - 04.04.2013

Hello guys, but I have a little problem with the spawn and they can not do it because I need the server roleplay...

pawn Код:
switch(dialogid)
    {
    case DIALOG_REGISTER:
    {
    if(!response)return Kick(playerid);
    if(response)
    {
    if(!strlen(inputtext))return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD ,"Registracija ","Dobrodosli na South Style Roleplay server.\nVas profil ne postoji, molim da unesete vas password bi ste se registrovali.","Reg","Izadji");
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Password",udb_hash(inputtext));
    INI_WriteInt(File,"AdminLevel",0);
    INI_WriteInt(File,"GameMaster",0);
    INI_WriteInt(File,"Level",1);
    INI_WriteInt(File,"Experian",0);
    INI_WriteInt(File,"PlayedHours",0);
    INI_WriteInt(File,"Account",0);
    INI_WriteInt(File,"Donator",0);
    INI_WriteInt(File,"Sex",0);
    INI_WriteInt(File,"Age",0);
    INI_WriteInt(File,"Origin",0);
    INI_WriteInt(File,"Character",0);
    INI_WriteInt(File,"Money",1000);
    INI_WriteInt(File,"Job",0);
    INI_WriteInt(File,"House",0);
    INI_WriteInt(File,"Business",0);
    INI_WriteInt(File,"Phone",0);
    INI_WriteInt(File,"Phonebook",0);
    INI_WriteInt(File,"Leader",0);
    INI_WriteInt(File,"Member",0);
    INI_WriteInt(File,"Rank",0);
    INI_WriteInt(File,"Tutorial",0);
    INI_Close(File);
    SpawnPlayer(playerid);
    }
    }
    }
   
    switch(dialogid)
    {
    case DIALOG_LOGIN:
    {
    if(!response)return Kick(playerid);
    if(response)
    {
    if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
    {
    INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]);
    SpawnPlayer(playerid);
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Logiranje","Dobrodosli na South Style Roleplay server.\nVas profil postoji, molim da unesete vas password da bi ste se ulogovali.","Logiraj se","Izadji");
    }
    }
    }
    }
pawn Код:
public SetPlayerSpawn(playerid)
{
    if(IsPlayerConnected(playerid))
    {
    SetPlayerSkin(playerid,PlayerInfo[playerid][pCharacter]);
    if(PlayerInfo[playerid][pTutorial] == 0)
    ShowPlayerDialog(playerid,DIALOG_SEX,DIALOG_STYLE_LIST,"Da li ste musko ili zensko?","Musko\nZensko","Izaberi","Izadji");
    SetPlayerPos(playerid,330.6825,163.6688,1014.1875);
    SetPlayerFacingAngle(playerid,280);
    SetPlayerInterior(playerid,3);
    TogglePlayerControllable(playerid,0);
    RegistrationStep[playerid] = 1;
    }
    return 1;
}
Sorry I bad english.


Re: How to make spawn? - Igi_Guduric - 04.04.2013

Please help me.


Re: How to make spawn? - Igi_Guduric - 04.04.2013

Please help me guys.


Re: How to make spawn? - Revo - 04.04.2013

Please do not double/triple post, guidance will come eventually, not instantly.

First off all, your code will look a lot better if you properly format it, have a look at http://en.wikipedia.org/wiki/Indentation

Second of all, I wasn't sure what the rest of your code looks like, especially player spawning, but, take a look at https://sampwiki.blast.hk/wiki/SetSpawnInfo

Also, it's better to not force a player to spawn, rather let https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn take care of that when they enter the screen selection.