any way to do that
#1

hellp sa-mp community
i'm asking if there is a way to send a command /cmd when the player click the textdraw ?
Reply
#2

Here
Reply
#3

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
Reply
#4

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.
Reply
#5

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
Reply
#6

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 ?
Reply
#7

Are you using ZCMD for your commands?
Reply
#8

Quote:
Originally Posted by bgedition
Посмотреть сообщение
Are you using ZCMD for your commands?
yes .
Reply
#9

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.
Reply
#10

PHP код:
C:\Users\Mehdi\Desktop\SA-MP\Nova-Project\gamemodes\dmrace.pwn(1361) : error 017undefined symbol "params"
C:\Users\Mehdi\Desktop\SA-MP\Nova-Project\gamemodes\dmrace.pwn(1364) : error 017undefined symbol "playerid"
C:\Users\Mehdi\Desktop\SA-MP\Nova-Project\gamemodes\dmrace.pwn(1359) : warning 203symbol is never used"cmd"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)