OnPlayerKeyStateChange and OnPlayerClickTextDraw
#1

I'm through making a "click textdraw = get a wep" script, but I can't seem to find out what's causing these warnings, I will be very grateful if someone could explain it to me.

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Textdraw0[playerid])
    {
       GivePlayerWeapon(playerid, 22, 9999);
       SetPlayerArmedWeapon(playerid, 22);
    }
    if(clickedid == Textdraw1[playerid])
    {
       GivePlayerWeapon(playerid, 25, 9999);
       SetPlayerArmedWeapon(playerid, 25);
    }
    if(clickedid == Textdraw2[playerid])
    {
       GivePlayerWeapon(playerid, 28, 9999);
       SetPlayerArmedWeapon(playerid, 28);
    }
    if(clickedid == Textdraw3[playerid])
    {
       GivePlayerWeapon(playerid, 30, 9999);
       SetPlayerArmedWeapon(playerid, 30);
    }
    if(clickedid == Textdraw4[playerid])
    {
       GivePlayerWeapon(playerid, 28, 9999);
       SetPlayerArmedWeapon(playerid, 0);
    }
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_YES)
    {
    TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
    }
    return 1;
}
Код:
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(468) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(469) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(470) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(471) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(472) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(473) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(474) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(568) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(573) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(578) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(583) : warning 213: tag mismatch
C:\Program Files (x86)\GTA San Andreas\SAMP\SA-MP Server\gamemodes\rdm.pwn(588) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Warnings.
Reply
#2

Properly define the textdraws with the Text: tag.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Properly define the textdraws with the Text: tag.
pawn Код:
new PlayerText:Textdraw0[MAX_PLAYERS];
new PlayerText:Textdraw1[MAX_PLAYERS];
new PlayerText:Textdraw2[MAX_PLAYERS];
new PlayerText:Textdraw3[MAX_PLAYERS];
new PlayerText:Textdraw4[MAX_PLAYERS];
new PlayerText:Textdraw5[MAX_PLAYERS];
new PlayerText:Textdraw6[MAX_PLAYERS];
I do believe that this is correct, right?
Reply
#4

The problem is your using global textdraws when you should be using player textdraws.

https://sampwiki.blast.hk/wiki/PlayerTextDrawShow
Reply
#5

Alright, I fixed the PlayerTextDrawShow problem, but I'm still getting Tag Mismatch on the following part:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Textdraw0[playerid])
    {
       GivePlayerWeapon(playerid, 22, 9999);
       SetPlayerArmedWeapon(playerid, 22);
    }
    else if(clickedid == Textdraw1[playerid])
    {
       GivePlayerWeapon(playerid, 25, 9999);
       SetPlayerArmedWeapon(playerid, 25);
    }
    else if(clickedid == Textdraw2[playerid])
    {
       GivePlayerWeapon(playerid, 28, 9999);
       SetPlayerArmedWeapon(playerid, 28);
    }
    else if(clickedid == Textdraw3[playerid])
    {
       GivePlayerWeapon(playerid, 30, 9999);
       SetPlayerArmedWeapon(playerid, 30);
    }
    else if(clickedid == Textdraw4[playerid])
    {
       GivePlayerWeapon(playerid, 28, 9999);
       SetPlayerArmedWeapon(playerid, 0);
    }
    return 1;
}
Reply
#6

I guess you didn't read everything then.

https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)