how do i disable this?
#1

I have a /hits script. This code will show the current hits:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(hit, 3, cmdtext);

    if(!strcmp(cmdtext, "/hits", true))
    {
        new count = 0;
        SendClientMessage(playerid, COLOR_MSG, "Current Hits:");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && hit[i] > 0)
            {
                new string[256];
                format(string, 256, "%s (%i) for $%i", ReturnPlayerName(i), i, hit[i]);
                SendClientMessage(playerid, COLOR_FOUND, string);
                count++;
            }
        }
        if(count == 0)
        {
            SendClientMessage(playerid, COLOR_ERROR, "No Hits Placed At This Time.");
    }
        return 1;
}

    return 0;
    }
My gTeam is "Team_Cop" without quotes. I want it so when gTeam == Team_Cop, it will SendClientMessage "You are a cop. You cannot see the hits!" Also, this is not in my gamemode. It's a filterscript so how can i define Team_Cop? +REP
Reply
#2

you can use:

pawn Код:
if(gTeam[playerid] == Team_Cop) // check' is player a coop.
    return SendClientMessage(playerid, -1,"You are a cop you cannot see the hits");
Reply
#3

Yes thanks. That's what I did but it says Team_Cop is not defined. How can I define it from my gamemode?
Reply
#4

Define in top of gamemode
pawn Код:
#define Team_Cop     (20)
// More team in here
Reply
#5

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Define in top of gamemode
pawn Код:
#define Team_Cop     (20)
// More team in here
No sorry I mean the "hits" is a filterscript. So how can I define gTeam and Team_Cop in my filterscript and link it to my GM so my GM and filterscript is compatible?
Reply
#6

pawn Код:
// InFilterScript
new team[MAX_PLAYERS];
getTeam(p,value); public getTeam(p,value)
{
    team[p] = value;
    return 1;
}

if(team[playerid] == Team_Cops)
{

}


// InOnPlayerSpawn (GAMEMODE)
CallRemoteFunction("getTeam", "ii", playerid, gTeam[playerid]);
Reply
#7

Thanks but here is the error:

Код:
error 010: invalid function or declaration
Here is the line that has the error:

Код:
if(team[playerid] == Team_Cops)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)