Spawn requesting ?
#1

Hello

I want that it wont spawn player if he don't click the dialog [RANDOM],[SPAWNED]

Код:
public OnPlayerRequestSpawn(playerid)
{
if(gPlayerLogged[playerid] == 1)
{
ShowPlayerDialog(playerid,DIALOG_REQUEST_SPAWN_STYLE,DIALOG_STYLE_MSGBOX,""COL_GREEN"How do you want to spawn?",""COL_GREEN"Select","Random","Saved");
}
return 1;
}

//under dialog response

if(response)
{
SavedSpawnPlayer[playerid] = 0;
RandomSpawnPlayer[playerid] = 1;
SpawnPlayer(playerid);
}
if(!response)
{
RandomSpawnPlayer[playerid] = 0;
SavedSpawnPlayer[playerid] = 1;
SpawnPlayer(playerid);
}
}

//under onplayer spawn
if(RandomSpawnPlayer[playerid] == 1)
{
bla bla bla
}
if(SavedSpawnPlayer[playerid] == 1)
{
bla bla bla
}
}
Reply
#2

Try this:
PHP код:
public OnPlayerRequestSpawn(playerid)
{
if(
gPlayerLogged[playerid] == 1)
{
ShowPlayerDialog(playerid,DIALOG_REQUEST_SPAWN_STYLE,DIALOG_STYLE_MSGBOX,""COL_GREEN"How do you want to spawn?",""COL_GREEN"Select","Random","Saved");
return 
0;
}
return 
1;
}

//under dialog response

if(response)
{
SavedSpawnPlayer[playerid] = 0;
RandomSpawnPlayer[playerid] = 1;
SpawnPlayer(playerid);
}
if(!
response)
{
RandomSpawnPlayer[playerid] = 0;
SavedSpawnPlayer[playerid] = 1;
SpawnPlayer(playerid);
}

Reply
#3

Thanks its working Thanks
Reply
#4

but how to make if he isnt logged that he must login?
Reply
#5

PHP код:
public OnPlayerRequestSpawn(playerid)
{
if(
gPlayerLogged[playerid] == 0)
{
    
//show the login dialog here
return 0;
}
if(
gPlayerLogged[playerid]==1)
{
ShowPlayerDialog(playerid,DIALOG_REQUEST_SPAWN_STYLE,DIALOG_STYLE_MSGBOX,""COL_GREEN"How do you want to spawn?",""COL_GREEN"Select","Random","Saved");
return 
0;
}
return 
1;

Reply
#6

unrechable code for this line

return 1;//-----
}
Reply
#7

I updated that post, try it now and also make sure that you changed that line according to your script.

If this didn't work, just put those lines I made in OnPlayerRequestClass
Reply
#8

Thanks its working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)