GameTextForAll with spicific people only.
#1

pawn Код:
/*
I am trying to make it only shows these announces when you are in a deathmatch.
In my Game Mode I use a bool to define if they are in a deathmatch or not. But I am
trying it this way because I coudlent figure out how to do it with a bool. I am not sure
how to do this with GameTextForAll but only send it to the people in DM zones.
*/


#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

enum PlayerData
{
    DMMSG,
};

new PlayerInfo[MAX_PLAYERS][PlayerData];

forward deathmatchmessages(color,const string[]);
public deathmatchmessages(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][DMMSG] == 1) SendClientMessage(i, color, string); //I get a tag mismatch here if I change SendClientMessage to GameTextForAll
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(testing, 7, cmdtext);
  return 0;
}

dcmd_testing(playerid, params[])
{
    #pragma unused params
    #pragma unused playerid
    new string [128];
    format(string, sizeof(string), "The Bomb is ticking at A");
    GameTextForAll(string, 5000, 1); deathmatchmessages(0x33FF33AA,string); //Sommething weird here?
    return 1;
}
Reply
#2

Quote:
Originally Posted by [SU
BP13 ]
if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][DMMSG] == 1) SendClientMessage(i, color, string); //I get a tag mismatch here if I change SendClientMessage to GameTextForAll
yeah:

https://sampwiki.blast.hk/wiki/GameTextForAll
https://sampwiki.blast.hk/wiki/SendClientMessage

see the difference...

also:

use if(blabla == 1 && blablabla == 1) { thenthis... }
Reply
#3

Quote:

//I get a tag mismatch here if I change SendClientMessage to GameTextForAll

You can't use GameTextForAll with playerid or i...
pawn Код:
GameTextForAll("HI", 5000, 3 );
try:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][DMMSG] == 1) GameTextForPlayer(i, string, 3000, 4);
     }
    return 1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)