SA-MP Forums Archive
After Dead returned to Class Selection - 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: After Dead returned to Class Selection (/showthread.php?tid=411859)



After Dead returned to Class Selection - Psycho77 - 30.01.2013

Hey Guys

I have a problem which i never had bevore.

I use the function SetSpawnInfo.

Now i have the problem, if i die, he returned to the Class Selection without using f4.


I hope you can help me


AW: After Dead returned to Class Selection - Blackazur - 30.01.2013

Give us the Code, without that we cant help you much.


Re: After Dead returned to Class Selection - Psycho77 - 30.01.2013

Yes, sorry

here is the code:

Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,1471.4336,-1644.5586,-24.5124);
    SetPlayerCameraPos(playerid,1412.2692,-1579.9993,86.7087);
    SetPlayerCameraLookAt(playerid,1495.5496,-1706.9076,14.5469);
    new str[200];
    if(AccountExist(pName[playerid]))
    {
        format(str,sizeof(str),"{FFFFFF}Guten Tag {00FF00}%s{FFFFFF},\nes wurde ein Account mit diesem Namen gefunden.\nMцchten Sie sich einloggen?",pName[playerid]);
		ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_MSGBOX,"{0000FF}Login",str,"Login","Abbrechen");
	}
	else
	{
	    format(str,sizeof(str),"{FFFFFF}Guten Tag {00FF00}%s{FFFFFF},\nes wurde kein Account mit diesem Namen gefunden.\nMцchten Sie sich registrieren?",pName[playerid]);
	    ShowPlayerDialog(playerid,Dialog_Register,DIALOG_STYLE_MSGBOX,"{0000FF}Login",str,"Registrieren","Abbrechen");
	}
	if(!GetPVarBool(playerid,"AllowSpawn")) return 0;
	return 1;
}

public OnPlayerConnect(playerid)
{
	GetPlayerName(playerid,pName[playerid],16);
	SetPlayerColor(playerid,0xFFFFFF00);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	StopAudioStreamForPlayer(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    if(!GetPVarBool(playerid,"AllowSpawn")) return 0;
	return 1;
}



Re: After Dead returned to Class Selection - jakejohnsonusa - 30.01.2013

So what exactly do you want to happen when the player dies?


Re: After Dead returned to Class Selection - Psycho77 - 30.01.2013

simple respawn on the position of the spawninfo


Re: After Dead returned to Class Selection - Scrillex - 31.01.2013

PHP код:
    if(AccountExist(pName[playerid]))
    {
        
format(str,sizeof(str),"{FFFFFF}Guten Tag {00FF00}%s{FFFFFF},\nes wurde ein Account mit diesem Namen gefunden.\nMцchten Sie sich einloggen?",pName[playerid]);
        
ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_MSGBOX,"{0000FF}Login",str,"Login","Abbrechen");
    }
    else
    {
        
format(str,sizeof(str),"{FFFFFF}Guten Tag {00FF00}%s{FFFFFF},\nes wurde kein Account mit diesem Namen gefunden.\nMцchten Sie sich registrieren?",pName[playerid]);
        
ShowPlayerDialog(playerid,Dialog_Register,DIALOG_STYLE_MSGBOX,"{0000FF}Login",str,"Registrieren","Abbrechen");
    }
    if(!
GetPVarBool(playerid,"AllowSpawn")) return 0
Why you have it there? Not on player connct?
If you wanted to disable class selection easyest way is:

Quote:

SpawnPlayer(playerid);




Re: After Dead returned to Class Selection - M3mPHi$_S3 - 31.01.2013

Show me The OnPlayerDEath Code ... If you have this
Код:
SpawnPlayer(playerid);
remove this .