what's wrong with this Command?
#1

Hi , i want to creat a Gate with Command only for A Team the name of it "UC" so , this is the command:

pawn Код:
CMD:uco(playerid, params[])
{
if(gTeam[playerid] == TEAM_UC)
      {
    MoveObject(ucgate, -9.41607475,1206.59936523,23.55257988, 2.0);
    SendClientMessage(playerid, 0xFFFFFF, "You Take Your Remote Console And Open The Gate...");
      }
      else
      {
      SendClientMessage(playerid, 0xAA3333AA, "You Must be U.C to Use this Gate !");
      }
    return 1;
}
so i have defined the Teams and all Working , but whene i go IG and i choose UC skin and use /uco it says:
"You Must be U.C to Use this Gate !"

BTW i have all Defined
pawn Код:
if(classid == 4)
    {
        gTeam[playerid] = TEAM_UC;
    }
    if(classid == 5)
    {
        gTeam[playerid] = TEAM_UC;
    }
Need Help...
Reply
#2

First of all - use some tabs to make your code looking much better:

pawn Код:
CMD:uco(playerid, params[])
{
    if(gTeam[playerid] == TEAM_UC) return SendClientMessage(playerid, 0xAA3333AA, "You Must be U.C to Use this Gate !");
    {
        MoveObject(ucgate, -9.41607475,1206.59936523,23.55257988, 2.0);
        SendClientMessage(playerid, 0xFFFFFF, "You Take Your Remote Console And Open The Gate...");
    }
    return 1;
}
NOTE: This doens't solve the problem.
Reply
#3

Fixed sorry Guys the problem was in public OnPlayerSpawn(playerid)

BTW what is the difference of My Code and your Code ?
Reply
#4

Your indentation was abit missed up.
Reply
#5

Here is more simple code.

pawn Код:
CMD:uco(playerid, params[]) {
    if(!gTeam[playerid] == TEAM_UC) return SendClientMessage(playerid, 0xFFFFAAFF, "You must be Team UC to open UC gate.");
    MoveObject(ucgate, X, Y, Z, 2.0);
    SendClientMessage(playerid, 0xFFFFAAFF, "Your moving the gate of UC."); }
return 1;  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)