04.09.2015, 13:30
hellp sa-mp community
i'm asking if there is a way to send a command /cmd when the player click the textdraw ?
i'm asking if there is a way to send a command /cmd when the player click the textdraw ?
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; }
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; }
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