Key fire to remove textdraw
#1

do i do it like that?

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))

and under it textdrawdestroy?
Reply
#2

Maybe it's just me, but I don't get why everyone uses PRESSED(...) to detect just one key. I've always used this:

pawn Код:
if (newkeys & KEY_FIRE)
And yes.
Reply
#3

just warnings, it compiles but..
PHP код:
C:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(305) : warning 217loose indentation
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(381) : warning 217loose indentation
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(524) : warning 217loose indentation
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(542) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(543) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(544) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(545) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(546) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(547) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(548) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(549) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(550) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(632) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(633) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(634) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(635) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(636) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(637) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(638) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(639) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(640) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(642) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(643) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(644) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(645) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(646) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(647) : warning 213tag mismatch
C
:\Users\yan\Desktop\Los santos GW\gamemodes\VFGW.pwn(648) : warning 213tag mismatch
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase


28 Warnings

Reply
#4

if(newkeys == KEY_FIRE)
{
TextDrawHideForPlayer(playerid, textdrawid);
}
or PlayerTextDrawHide(playerid, playertextdrawid); for playertextdraw
Reply
#5

show us : 305 , 381 , 550 lines please
Reply
#6

all of em are loose ind, idc about it, btw when i press FIRE KEY it doesn't remove all..
Reply
#7

"newkeys" contains a bit value, you don't use "==" to compare it...

And also show some more code.
Reply
#8

if u want i'll show u ALL of my weapon shop sys textdraw

but for now

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
 if (
newkeys KEY_FIRE)
 {
  
TextDrawDestroy(Textdraw:0);
  
TextDrawDestroy(Textdraw:1);
  
TextDrawDestroy(Textdraw:2);
  
TextDrawDestroy(Textdraw:3);
  
TextDrawDestroy(Textdraw:4);
  
TextDrawDestroy(Textdraw:5);
  
TextDrawDestroy(Textdraw:6);
  
TextDrawDestroy(Textdraw:7);
  
TextDrawDestroy(Textdraw:8);

  
TextDrawDestroy(Textdraw9[playerid]);
  
TextDrawDestroy(Textdraw10[playerid]);
  
TextDrawDestroy(Textdraw11[playerid]);
  
TextDrawDestroy(Textdraw12[playerid]);
  
TextDrawDestroy(Textdraw13[playerid]);
  
TextDrawDestroy(Textdraw14[playerid]);
  
TextDrawDestroy(Textdraw15[playerid]);
 }
 return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)