Players Freeze on Spawn Unintentionally - 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: Players Freeze on Spawn Unintentionally (
/showthread.php?tid=479451)
Players Freeze on Spawn Unintentionally -
Excelize - 05.12.2013
Hey guys,
Sorry to bother again, but i just created a new Dialog spawn choosing system, which allows you to choose your spawn.
My problem is, that when the player spawns, the game automatically freezes them.
My code:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)//Class
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerScore(playerid) >= 0)
{
SendClientMessage(playerid, blue, "*You have chosen the Trucker Class");
SetPlayerPos(playerid, 0,0,3.0);
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Choose Your Spawn", "Los Santos Depot","Spawn", "");
TogglePlayerControllable(playerid, 1);
gPlayerClass[playerid] = TRUCKER;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
}
}
if(dialogid == 6)//Spawn
{
if(listitem == 0)
{
SetPlayerPos(playerid, 2483.5586,-2119.3044,13.5469);
TogglePlayerControllable(playerid, 1);
}
}
How can i make it so it doesnt freeze?..
Re: Players Freeze on Spawn Unintentionally -
Loot - 05.12.2013
All I can see is that you're unfreezing them in the code above.
However, I do see is that you're checking dialogid 6 INSIDE dialogid 0, which shouldn't be, at all.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)//Class
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerScore(playerid) >= 0)
{
SendClientMessage(playerid, blue, "*You have chosen the Trucker Class");
SetPlayerPos(playerid, 0,0,3.0);
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Choose Your Spawn", "Los Santos Depot","Spawn", "");
TogglePlayerControllable(playerid, 1);
gPlayerClass[playerid] = TRUCKER;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
}
}
// ...
}
}
if(dialogid == 6)//Spawn
{
if(response)
{
if(listitem == 0)
{
SetPlayerPos(playerid, 2483.5586,-2119.3044,13.5469);
TogglePlayerControllable(playerid, 1);
}
}
// ...
}
}