Automatic Command? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Automatic Command? (
/showthread.php?tid=268275)
Automatic Command? -
HayZatic - 12.07.2011
How could i do an Automatic command? Like the System types the Command not you?
I want it to automatically type /chooseclass
Re: Automatic Command? -
=WoR=Varth - 12.07.2011
Use timer.
Re: Automatic Command? -
dowster - 12.07.2011
turn the command into a function
Re: Automatic Command? -
HayZatic - 12.07.2011
Quote:
Originally Posted by dowster
turn the command into a function
|
How so?
Re: Automatic Command? -
dowster - 12.07.2011
Код:
forward Function(any params here);
public Function(same params)
{
stuff to do;
}
fairly easy
Re: Automatic Command? -
HayZatic - 12.07.2011
forward Function(ChooseClass);
public Function(ChooseClass)
{
SendClientMessage(playerid,COLOR, " BlahBlahBlah");
return 1;
}
Like That?
Re: Automatic Command? -
dowster - 12.07.2011
no like everything the command does, needs to be in the function. what exactly does this command do? put the player in the class selection menu? please post the code. thank you.
Re: Automatic Command? -
HayZatic - 12.07.2011
Код:
if(strcmp("/ChooseClass", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,699,DIALOG_STYLE_LIST,"Choose Class","Sniper Class\nAssualt Class\nRocket Class ($150)\nPilot Class ($200)\n","Accept", "Exit");
return 1;
}
And of course i have my Whole Dialog crap
Re: Automatic Command? -
PotH3Ad - 12.07.2011
You could do
pawn Код:
OnPlayerCommandText(playerid, "/chooseclass");
Re: Automatic Command? -
dowster - 12.07.2011
Код:
//top of script
forward chooseclass{};
//somewhere, could be bottom, idc
public chooseclass{}
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
ShowPlayerDialog(i,699,DIALOG_STYLE_LIST,"Choose Class","Sniper Class\nAssualt Class\nRocket Class ($150)\nPilot Class ($200)\n","Accept", "Exit");
}
return 1;
}
how would you like it to be started? another command, timer?