19.04.2012, 23:57
I have a /hits script. This code will show the current hits:
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
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;
}