SA-MP Forums Archive
Making team only 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: Making team only command (/showthread.php?tid=300315)



Making team only command - BoboRi - 29.11.2011

I need help for making a command only for team 1

Example:

I have this command and I wan't to enable it only for team 1 that I defined on the beggining of the script as
pawn Код:
#define TEAM_POLICE 1
pawn Код:
CMD:open(playerid, params[])
{
    SetDynamicObjectRot(barrier1, 0.00000000,0.00000000,325.48645020);
    SendClientMessage(playerid, COLOR_SKYBLUE, "OPENED");
    return 1;
}
CMD:close(playerid, params[])
{
        SetDynamicObjectRot(barrier1, 0.0, 270.00000000,325.48645020);
    SendClientMessage(playerid, COLOR_SKYBLUE, "CLOSED");
    return 1;
}
Can somebody help me making this command?

Thanks for helping =)


Re: Making team only command - Hoss - 29.11.2011

pawn Код:
CMD:open(playerid, params[])
{
    if(gTeam[playerid] != TEAM_POLICE)
    return SendClientMessage(playerid,0xFF0000C8, "You are not Police Officer");
    SetDynamicObjectRot(barrier1, 0.00000000,0.00000000,325.48645020);
    SendClientMessage(playerid, COLOR_SKYBLUE, "OPENED");
    return 1;
}
CMD:close(playerid, params[])
{
    if(gTeam[playerid] != TEAM_POLICE)
    return SendClientMessage(playerid,0xFF0000C8, "You are not Police Officer");
    SetDynamicObjectRot(barrier1, 0.0, 270.00000000,325.48645020);
    SendClientMessage(playerid, COLOR_SKYBLUE, "CLOSED");
    return 1;
}



Re: Making team only command - BoboRi - 29.11.2011

Thanks =)

Rep+ forya