After Dead returned to Class Selection
#1

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
Reply
#2

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

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;
}
Reply
#4

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

simple respawn on the position of the spawninfo
Reply
#6

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);

Reply
#7

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


Forum Jump:


Users browsing this thread: 2 Guest(s)