Spawn requesting ? - 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: Spawn requesting ? (
/showthread.php?tid=571152)
Spawn requesting ? -
kalanerik99 - 16.04.2015
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
}
}
Re: Spawn requesting ? -
ATGOggy - 16.04.2015
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);
}
}
Re: Spawn requesting ? -
kalanerik99 - 16.04.2015
Thanks its working Thanks
Re: Spawn requesting ? -
kalanerik99 - 16.04.2015
but how to make if he isnt logged that he must login?
Re: Spawn requesting ? -
ATGOggy - 16.04.2015
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;
}
Re: Spawn requesting ? -
kalanerik99 - 16.04.2015
unrechable code for this line
return 1;//-----
}
Re: Spawn requesting ? -
ATGOggy - 16.04.2015
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
Re: Spawn requesting ? -
kalanerik99 - 16.04.2015
Thanks its working