How Can I Do This? - 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: How Can I Do This? (
/showthread.php?tid=77913)
How Can I Do This? -
notec100 - 15.05.2009
How would I be able to link a command such as /ticket to be able to work using either /ticket or by pressing the sub mission button? Basically I have the command made I just need to know how to use the sub mission button with it and other commands as well. Thanks in advance!
Re: How Can I Do This? -
yom - 16.05.2009
Something like this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_SUBMISSION)
{
OnPlayerCommandText(playerid, "/ticket");
//if /ticket is in another script, use:
//CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/ticket");
return true;
}
return false;
}
Re: How Can I Do This? -
notec100 - 16.05.2009
Quote:
Originally Posted by 0rb
Something like this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (newkeys & KEY_SUBMISSION) { OnPlayerCommandText(playerid, "/ticket"); //if /ticket is in another script, use: //CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/ticket"); return true; }
return false; }
|
Thanks so much I really appreciate it!
Now I need to know how I could associate this with a dcmd command please. Would it be OnPlayerCommandText(playerid, "dcmd_command");? Thanks in advance!
Re: How Can I Do This? -
yom - 16.05.2009
Np,
You just need to call
pawn Код:
dcmd_ticket(playerid, ""); //instead of OnPlayerCommandText(playerid, "/ticket");
(i think)
Re: How Can I Do This? -
notec100 - 16.05.2009
Quote:
Originally Posted by 0rb
Np,
You just need to call
pawn Код:
dcmd_ticket(playerid, ""); //instead of OnPlayerCommandText(playerid, "/ticket");
(i think)
|
Ah I see lol lemme give it a try and I will post the outcome and once again thank you fingers crossed XXXX I hope this works!
EDIT
I just tried that out and for some reason it does not work :P I wish there was like a small tut on this sort of thing