One script into the other? Wanne make"/cctv" admin command...
#1

Hello,

To all of u great scripters, i wanne ask something,
i'm making my own sa:mp server with allot of scripts like the one from "Bread" (object editor) - (having trouble, cause positions do not save to file but )
anyways ... there is this FS that's all about one command "/cctv" and i have another script that's all about the admin levels and stuff.. now what i wanne do is that only admins can use "/cctv" ... how do i do this?

Implement the one FS into the other (if yes ... how? )or refer to it into the other?

Idk

Greets Rizzy
Reply
#2

Im not positive but why not add a command for it under your Gamemode

And if that doesnt work add these:
Код:
enum pInfo
{
	pAdmin,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Then do this
Код:
    if (strcmp("/cctv", cmdtext, true) == 0)
{
			if (PlayerInfo[playerid][pAdmin] >= 1)
   {
        if(Spawned[playerid] == 1)
        {
          PlayerMenu[playerid] = 0;
          TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(CCTVMenu[0], playerid);
        }
        else
        {
          SendClientMessage(playerid, 0xFF0000AA, "Please spawn first!");
        }
        return 1;
    }
    
    if (strcmp("/exitcctv", cmdtext, true) == 0)
    {
			if (PlayerInfo[playerid][pAdmin] >= 1)
{
      if(CurrentCCTV[playerid] > -1)
      {
          SetPlayerPos(playerid, LastPos[playerid][LX], LastPos[playerid][LY], LastPos[playerid][LZ]);
            SetPlayerFacingAngle(playerid, LastPos[playerid][LA]);
        SetPlayerInterior(playerid, LastPos[playerid][LInterior]);
          TogglePlayerControllable(playerid, 1);
          KillTimer(KeyTimer[playerid]);
          SetCameraBehindPlayer(playerid);
          TextDrawHideForPlayer(playerid, TD);
      CurrentCCTV[playerid] = -1;
      return 1;
        }
    }
    return 0;
}
Reply
#3

Thnx for fast reply but i don't think this is gonna work (tried)...
My gamemode is a pawno file, there's another one for the /cctv command and one for the admin levels (including register system).
Sow they are all different script files.

I don't think they can comunicate so how should i do this?

Grts Rizzy
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)