SA-MP Forums Archive
what's wrong with this Command? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: what's wrong with this Command? (/showthread.php?tid=280744)



what's wrong with this Command? - ServerScripter - 02.09.2011

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...


Re: what's wrong with this Command? - Kingunit - 02.09.2011

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.


Re: what's wrong with this Command? - ServerScripter - 02.09.2011

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

BTW what is the difference of My Code and your Code ?


Re: what's wrong with this Command? - Kingunit - 02.09.2011

Your indentation was abit missed up.


Re: what's wrong with this Command? - Davz*|*Criss - 02.09.2011

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;  }