any way to do that - 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: any way to do that (
/showthread.php?tid=587962)
any way to do that -
houssam501 - 04.09.2015
hellp sa-mp community
i'm asking if there is a way to send a command /cmd when the player click the textdraw ?
Re: any way to do that -
karemmahmed22 - 04.09.2015
Here
Re: any way to do that -
Nour1 - 04.09.2015
it's Kinda Impossiple but i suggest to Write what you want on the text draw then he won't be in need for clicking on it
Re: any way to do that -
bgedition - 04.09.2015
Hey there in my signature you can find a link. Make it stock and then use it to force your command. But this is in case if you are using ZCMD.
Re: any way to do that -
houssam501 - 04.09.2015
it's just a lobby when u click it , it need to load the gm
the gm can also load by typing /dm
i have 3 gms on my script
Re: any way to do that -
houssam501 - 04.09.2015
Quote:
Originally Posted by bgedition
Hey there in my signature you can find a link. Make it stock and then use it to force your command. But this is in case if you are using ZCMD.
|
can you be more specific or maybe write the code that you mean ?
Re: any way to do that -
bgedition - 04.09.2015
Are you using ZCMD for your commands?
Re: any way to do that -
houssam501 - 04.09.2015
Quote:
Originally Posted by bgedition
Are you using ZCMD for your commands?
|
yes .
Re: any way to do that -
bgedition - 04.09.2015
Put this in your script:
Код:
stock forcecmd(cmd[]) {
new Command[34], Params[129], string[50];
if(sscanf(params, "s[32]S()[128]", Command, Params)) return 0;
if(Command[0] == '/') strdel(Command, 0, 1);
format(string, sizeof(string), "cmd_%s", Command);
if(!CallLocalFunction(string, "s", isnull(Params) ? ("\1") : Params)) return SendClientMessage(playerid, -1, "{E03636}[ERROR]: {FFFFFF}This command is unknown.");
return 1;
}
Then do this:
Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) {
if(playertextid == THE ID OF YOUR SELECTABLE TEXTDRAW HERE) {
forcecmd("/dm"); // if you have any params add and them
CancelSelectTextDraw(playerid);
}
return 1;
}
This is untested and I hope it will work.
Re: any way to do that -
houssam501 - 04.09.2015
PHP код:
C:\Users\Mehdi\Desktop\SA-MP\Nova-Project\gamemodes\dmrace.pwn(1361) : error 017: undefined symbol "params"
C:\Users\Mehdi\Desktop\SA-MP\Nova-Project\gamemodes\dmrace.pwn(1364) : error 017: undefined symbol "playerid"
C:\Users\Mehdi\Desktop\SA-MP\Nova-Project\gamemodes\dmrace.pwn(1359) : warning 203: symbol is never used: "cmd"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase