Help with OnPlayerClickTextdraw - 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: Help with OnPlayerClickTextdraw (
/showthread.php?tid=473674)
Help with OnPlayerClickTextdraw -
Vege - 03.11.2013
Ok, So I recently started scripting my new CnR GM for my server and I had a idea of choosing class i.e cop or robber
using textdraws but since I am a newbie with textdraws I'd like some HUMAN help, well ofcourse i've read every topic related to textdraws at sa-mp wiki by now....!
First Question: What is the players state in OnPlayerRequestClass?(I mean since I have to make these textdraws for class what would I put) ?
pawn Код:
if(newkeys == KEY_SUBMISSION)
{
TextDrawShowForPlayer(playerid, Textdraw[5]);
SelectTextDraw(playerid, 0xFFFFFFFF);
}
^^This is my OnPlayerKeyStateChange Code. //Taken From Wiki Ofcourse.
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw[5])
{
TextDrawShowForPlayer(playerid, Textdraw[15]);
SCM(playerid, green,"it's working yippee"); //that's a random SendClientMessage i made to check if it works :)
CancelSelectTextDraw(playerid);
}
}
^^This is my OnPlayerClickTextDraw Code. By the way here I have written this
pawn Код:
TextDrawShowForPlayer(playerid, Textdraw[15]);
this is Textdraw[15] is this where I am making a mistake? Cause I want to show another rules text draw when player chooses his class...
pawn Код:
Textdraw[5] = TextDrawCreate(209.999954, 152.963043, "Bank Robber");
TextDrawLetterSize(Textdraw[5], 0.345555, 1.340741);
TextDrawTextSize(Textdraw[5], 414.999938, 37.333335);
TextDrawAlignment(Textdraw[5], 1);
TextDrawColor(Textdraw[5], 41215);
TextDrawUseBox(Textdraw[5], true);
TextDrawBoxColor(Textdraw[5], 0);
TextDrawSetShadow(Textdraw[5], 0);
TextDrawSetOutline(Textdraw[5], 1);
TextDrawBackgroundColor(Textdraw[5], 51);
TextDrawFont(Textdraw[5], 2);
TextDrawSetProportional(Textdraw[5], 1);
TextDrawSetSelectable(Textdraw[5], true);
^^ this is the Textdraw[5] Code.
Actually I want it that when I click on the textdraw the player spawns as a robber, well I've done the spawn as a robber part but I am not being able to get the textdraw to be clickable in OnPlayerClassRequest or anywhere else too!
Any Help regarding this would be appreciated....
Re: Help with OnPlayerClickTextdraw -
Vege - 03.11.2013
Sorry Fixed :P Kept trying on it found my big blunder!