[HELP] /myteam problem
#4

Quote:
ScRipTeRi:
if (strcmp("/myteam", cmdtext, true, 10) == 0)
{
if(pTeam[playerid] == TEAM_POLICE){
SendClientMessage(playerid,COLOR_BLUE,"You're a police officer");
return 1;
}
if(pTeam[playerid] == TEAM_CRINIMALS){
SendClientMessage(playerid,COLOR_RED,"You're a crinimal");
return 1;
}

if(pTeam[playerid] == TEAM_CRIMINALS should be TEAM_wCriminals

Quote:
FishyZ:
new pTeam[MAX_PLAYERS];
#define TEAM_wCRINIMALS 0
#define TEAM_POLICE 1

Here is my working piece of code

pawn Код:
#define Criminals 0
#define Police 1
pawn Код:
new pTeam[MAX_PLAYERS];
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/myteam", cmdtext, true, 10) == 0)
    {
     if(pTeam[playerid] == 0)
        {
        SendClientMessage(playerid, -1, "You are a criminal");
        return 1;
        }
        if(pTeam[playerid] == 1)
        {
        SendClientMessage(playerid, -1, "You are a police officer");
        return 1;
        }
    }
    if (strcmp("/police", cmdtext, true, 10) == 0)
    {
        pTeam[playerid] = 1;
        return 1;
    }
    if (strcmp("/criminal", cmdtext, true, 10) == 0)
    {
        pTeam[playerid] = 0;
        return 1;
    }
    return 0;
}
It worked fine for me (the /police and /criminal commands are just to test it ... you can remove them after)
Reply


Messages In This Thread
[HELP] /myteam problem - by FishyZ - 22.07.2013, 18:37
Re: [HELP] /myteam problem - by ZeroTheScyther - 22.07.2013, 18:39
Re: [HELP] /myteam problem - by ScRipTeRi - 22.07.2013, 18:41
Re: [HELP] /myteam problem - by ZeroTheScyther - 22.07.2013, 18:53
Re: [HELP] /myteam problem - by DobbysGamertag - 22.07.2013, 20:57
Re: [HELP] /myteam problem - by Chrisis - 22.07.2013, 23:25

Forum Jump:


Users browsing this thread: 2 Guest(s)