How To Make a Command Do Another 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)
+--- Thread: How To Make a Command Do Another Command (
/showthread.php?tid=355275)
How To Make a Command Do Another Command -
Anters14 - 29.06.2012
Can Someone Help Me Make a Command For Police, I Want To Make It So ONly PD Can Do It.
They Will Type /po And It Well Send The /m Command Saying "MDPD Pull Over To The RIGHT Side Of The Road". I Don't Know How To Do This, Any Help Would Be Appreciated, Thanks!
Thanks Anthony
Re: How To Make a Command Do Another Command -
seanny - 29.06.2012
What game mode are you using?
Re: How To Make a Command Do Another Command -
vassilis - 29.06.2012
pawn Код:
CMD:po(playerid,params[])
{
if(gteam[playerid] == class variable)
{
SendClientMessage(playerid,putcolorhere,"MDPD Pull Over To The Right Side Of The Road");
}
else
{
SendClientMessage(playerid,-1,"You are not MDPD to use this command!");
}
return 1;
}
Re: How To Make a Command Do Another Command -
iggy1 - 29.06.2012
pawn Код:
CMD:po2(playerid,params[])
return cmd_po(playerid, params);
EDIT: Sorry i replied to the thread name and not the first post, i think the code i posted is irrelevant.
Re: How To Make a Command Do Another Command -
vassilis - 29.06.2012
Quote:
Originally Posted by iggy1
pawn Код:
CMD:po2(playerid,params[]) return cmd_po(playerid, params);
EDIT: Sorry i replied to the thread name and not the first post, i think the code i posted is irrelevant.
|
Or that..
Re: How To Make a Command Do Another Command -
MadeMan - 29.06.2012
pawn Код:
CMD:po(playerid,params[])
{
return cmd_m(playerid, "MDPD Pull Over To The RIGHT Side Of The Road");
}
or
pawn Код:
CMD:po(playerid,params[])
{
return OnPlayerCommandText(playerid, "/m MDPD Pull Over To The RIGHT Side Of The Road");
}