SA-MP Forums Archive
[help]how to make spawn after selecting the class? - 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: [help]how to make spawn after selecting the class? (/showthread.php?tid=576372)



[help]how to make spawn after selecting the class? - Okrs - 03.06.2015

I have a problem, spawn the player first and then the class is selected, I want you first select the class and then if spawn. (problem in the /sc command)

if(ClassTaken[playerid] == 1)
{
ShowPlayerDialog(playerid, CLASS_DIALOG, DIALOG_STYLE_LIST,"Choose your class:","Soldier (0 scores - Rank 1)\nSniper (400 scores - Rank 3)\nPyroman (1,500 scores - Rank 5)\nSupporter (3,000 Scores - Rank 6)\nEngineer (5,000 scores - Rank 7)\nMedic (10,000 scores - Rank 9)\nPilot (15,000 scores - Rank11)\nSpy (20,000 Scores - Rank12)\nDonator (VIP Rank 3)","Choose","Back");
ClassTaken[playerid] = 0;

}

y este es el comando
CMD: sc(playerid, params[])
{
SendClientMessage(playerid, RED, "(PROCESSED): You will change your class after the next death!");
ClassTaken[playerid] = 1;
return 1;
}


Re: [help]how to make spawn after selecting the class? - Luis- - 03.06.2015

I don't understand what you're trying to do. I presume you're showing the dialog on OnPlayerDeath if the variable "ClassTaken" equals 1? If so, could you show the OnPlayerDeath function? (Just the part where you use the above variable.)


Re: [help]how to make spawn after selecting the class? - Rodri99 - 03.06.2015

Yo entendi que quieres decir, quieres un comando que te pone en la clas selection y despues te espawna...este es, usando zCMD include.... porfa dame +REP si te sirvio

CMD:class(playerid,params[]) {
new string[256];
format(string,sizeof(string),"INFO: You have forced yourself into class selection using /class"); SendClientMessage(playerid,orange,string);
ForceClassSelection(playerid);
return SetPlayerHealth(playerid,0.0);
}


el spawn es automatico al elegir el skin


Re: [help]how to make spawn after selecting the class? - Luis- - 03.06.2015

That isn't what he asked for.. He's obviously got his own class system that he wants to use instead of the default one. Also, please don't type in your own language, it's annoying.


Respuesta: Re: [help]how to make spawn after selecting the class? - Okrs - 03.06.2015

Quote:
Originally Posted by Luis-
Посмотреть сообщение
That isn't what he asked for.. He's obviously got his own class system that he wants to use instead of the default one. Also, please don't type in your own language, it's annoying.
this?
if(ClassTaken[playerid] == 0) return FirstSpawn[playerid] = 1;
foreach (Zones, i) if (CapturingZone[playerid] == i) LeavingCAPZONE(playerid, i);

I do not want to spawn




Re: [help]how to make spawn after selecting the class? - J0sh... - 03.06.2015

Use TogglePlayerSpectating if that's what you want.


Respuesta: Re: [help]how to make spawn after selecting the class? - Okrs - 03.06.2015

Quote:
Originally Posted by Jamester
Посмотреть сообщение
Use TogglePlayerSpectating if that's what you want.
not working :/


Re: [help]how to make spawn after selecting the class? - Luis- - 03.06.2015

You sure you're doing it right? Something like this should work;
pawn Код:
CMD: sc(playerid, params[])
{
SendClientMessage(playerid, RED, "(PROCESSED): You will change your class after the next death!");
ClassTaken[playerid] = 1;
TogglePlayerSpectating(playerid, true);
return 1;
}
The once you've chosen a class, add this;
pawn Код:
TogglePlayerSpectating(playerid, false);



Respuesta: Re: [help]how to make spawn after selecting the class? - Okrs - 03.06.2015

Quote:
Originally Posted by Luis-
Посмотреть сообщение
You sure you're doing it right? Something like this should work;
pawn Код:
CMD: sc(playerid, params[])
{
SendClientMessage(playerid, RED, "(PROCESSED): You will change your class after the next death!");
ClassTaken[playerid] = 1;
TogglePlayerSpectating(playerid, true);
return 1;
}
The once you've chosen a class, add this;
pawn Код:
TogglePlayerSpectating(playerid, false);
I did everything right




Re: [help]how to make spawn after selecting the class? - Luis- - 03.06.2015

Hmm, try setting the player spectating when they die, and want to change their class, then the dialog should show.