Jump to content
  • 0

comenzi


shaun

Question

cum fac ca atunci cand un player da o comanda ... sa nu poata accesa alte comenzi...sa il faca inapt la comenzi...

doar anumite comenzi ca am un script cu football....si nu vreau sa acceseze decat o singura comanda

u78ch.jpg

CHECK MY CHANNEL!

http://www.youtube.com/user/amysoica

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

Guest RockStar

Foloseste

if(!IsPlayerAdmin( playerid )) return SendClientMessage( playerid , 0xFFFFFFFF ," Nu esti admin ! " ) ; 

Si faci comanda accesibila doar pentru RCON Admin ...

Link to comment
Share on other sites

incerca sa creezi o noua fuctie pfotbalp si sa pui la fiecare comanda din mod ceva de genu

if(PlayerInfo[para1][pFotbalP] == 1)
{
             SendClientMessage(playerid, COLOR_GREY, "   Nu Poti Folosi Comenda Deoarece Joci Fotbal");
             return 1;
}

sper sa te ajute

Link to comment
Share on other sites

Guest PlayON

strcmp

Atunci, ia codu acesta, si punel sus de tot.


#define AllowCommand(%0)      if ( strcmp( cmdtext, %0, true) == 0 ) return 1;


Acuma in OnPlayerCommandText sa adaugam restrictia + functia care da voie la anumtele comenzi.


public OnPlayerCommandText( playerid, cmdtext[ ] )

{

    if ( Restrictie[ playerid ] )

    {

        //FARA ; la sfarsitul functii! (ca asa am vrut eu)

        AllowCommand("/cmd1")

        AllowCommand("/tre")

        AllowCommand("/xdi")

        AllowCommand("/1235f")

        SendClientMessage( playerid, 0xFF2020FF, "ERROR:{FFFFFF} Ai voie sa folosesti doar: /cmd1 /tre /xdi /1235f" );

        return 0;

    }

    //SUS IN ACEL PUBLIC, MAI JOS VIN TOATE COMENZILE

    return 0;

}


Foloseste ce variabila ai tu inloc de Restrictie[ playerid ]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Similar Content

    • By Hook SAMP
      Nu imi da nicio eroare cand compilez gamemode-ul , dar cand intru pe server si dau /shop si apas pe ceva , nu apare nimic , dispare dialogul , si la realizari cand dau /realizari nu apare nimic. Gamemode B-Hood
    • By TheGodfather
      Salut, am o problema cu aceste 2 comenzi. Imi pune checkpoint gresit cand cineva se afla intr-o casa/hq/biz
      YCMD:wanted(playerid, params[], help) {
          if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu faci parte din factiunea politiei.");
          if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
          new iString[1024],string[300],count = 0,online[50];
          strcat(iString, "Name\tWanted level\tChased by\n");
          if(IsPlayerConnected(playerid)) {
              foreach(Player,i) {
                  if(PlayerInfo[pWantedLevel] >= 1) {
                      SelectedPlayers[playerid][count] = i;
                      string[0] = 0;
                      format(string, sizeof(string), "%s (%d)\tWanted level %d\t%d cops\n",GetName(i),i,PlayerInfo[pWantedLevel],ChasedBy(i));
                      count++;
                      strcat(iString,string);
                  }
              }
              format(online, sizeof(online),"Wanted online: %d",count);
              if(count == 0) return SCM(playerid,COLOR_GREY, "Nu sunt suspecti conectati.");
              ShowPlayerDialog(playerid, DIALOG_WANTED, DIALOG_STYLE_TABLIST_HEADERS, online, iString , "Ok", "Exit");
          }
          return 1;
      }
       
      YCMD:find(playerid, params[], help) {
          if(JobWorking[playerid] == 1) return 1;
          if(CP[playerid] != 0 || targetfind[playerid] != -1) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
          new id,giveplayer[30],string[100];
          if(PlayerInfo[playerid][pJob] != 6 && PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pMember] != 14 && !IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu ai jobul 'Detective'.");
          if(sscanf(params, "u",id)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/find <playerid/name>");
          if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
          if(Spectate[id] != 255) return SCM(playerid, COLOR_GREY, "Acel player este ocupat!");
          if(id == playerid) return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda asupra ta!");
          if(togfind[id] == 1) return SCM(playerid,COLOR_GREY, "Acel player nu poate fi urmarit!");
          if(GetPVarInt(id, "Undercover") == 1) return SCM(playerid, COLOR_GREY, "Acel player este ocupat!");
          if(BizRobbed[playerid] != 0) return 1;
          if(togfind[id] == 1 && OnDuty[playerid] == 0 && PlayerHit[playerid] == -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu poate fi urmarit!");
          UsedFind[playerid] = 1;
          GetPlayerName(id, giveplayer, sizeof(giveplayer));
          new Float:X,Float:Y,Float:Z;
          GetPlayerPos(id, X,Y,Z);
          SetPlayerCheckpointEx(playerid, X,Y,Z, 3.5);
          targetfind[playerid] = id;
          CP[playerid] = 53;
          format(string, sizeof(string), "* Punctul rosu a fost setat pe %s (%d) care se afla in zona %s.",giveplayer,id,GetPlayerZone(id));
          SCM(playerid,COLOR_YELLOW,string);
          for(new m; m < 2; m++) {
              if(PlayerInfo[playerid][pDailyMission][m] == 12) CheckMission(playerid, m);
          }
           return 1;
      }
    • By TheGodfather
      Salut, am gasit un bug la urmatoarele comenzi, /find si /wanted, la ambele imi pune total gresit checkpoint-ul pe harta, ma puteti ajuta?
      YCMD:find(playerid, params[], help) {
          if(JobWorking[playerid] == 1) return 1;
          if(CP[playerid] != 0 || targetfind[playerid] != -1) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
          new id,giveplayer[30],string[100];
          if(PlayerInfo[playerid][pJob] != 6 && PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pMember] != 14 && !IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu ai jobul 'Detective'.");
          if(sscanf(params, "u",id)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/find <playerid/name>");
          if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
          if(Spectate[id] != 255) return SCM(playerid, COLOR_GREY, "Acel player este ocupat!");
          if(id == playerid) return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda asupra ta!");
          if(togfind[id] == 1) return SCM(playerid,COLOR_GREY, "Acel player nu poate fi urmarit!");
          if(GetPVarInt(id, "Undercover") == 1) return SCM(playerid, COLOR_GREY, "Acel player este ocupat!");
          if(BizRobbed[playerid] != 0) return 1;
          if(togfind[id] == 1 && OnDuty[playerid] == 0 && PlayerHit[playerid] == -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu poate fi urmarit!");
          UsedFind[playerid] = 1;
          GetPlayerName(id, giveplayer, sizeof(giveplayer));
          new Float:X,Float:Y,Float:Z;
          GetPlayerPos(id, X,Y,Z);
          SetPlayerCheckpointEx(playerid, X,Y,Z, 3.5);
          targetfind[playerid] = id;
          CP[playerid] = 53;
          format(string, sizeof(string), "* Punctul rosu a fost setat pe %s (%d) care se afla in zona %s.",giveplayer,id,GetPlayerZone(id));
          SCM(playerid,COLOR_YELLOW,string);
          for(new m; m < 2; m++) {
              if(PlayerInfo[playerid][pDailyMission][m] == 12) CheckMission(playerid, m);
          }
           return 1;
      }
       
      YCMD:wanted(playerid, params[], help) {
          if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu faci parte din factiunea politiei.");
          if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
          new iString[1024],string[300],count = 0,online[50];
          strcat(iString, "Name\tWanted level\tChased by\n");
          if(IsPlayerConnected(playerid)) {
              foreach(Player,i) {
                  if(PlayerInfo[pWantedLevel] >= 1) {
                      SelectedPlayers[playerid][count] = i;
                      string[0] = 0;
                      format(string, sizeof(string), "%s (%d)\tWanted level %d\t%d cops\n",GetName(i),i,PlayerInfo[pWantedLevel],ChasedBy(i));
                      count++;
                      strcat(iString,string);
                  }
              }
              format(online, sizeof(online),"Wanted online: %d",count);
              if(count == 0) return SCM(playerid,COLOR_GREY, "Nu sunt suspecti conectati.");
              ShowPlayerDialog(playerid, DIALOG_WANTED, DIALOG_STYLE_TABLIST_HEADERS, online, iString , "Ok", "Exit");
          }
          return 1;
      }
    • By ionutBILOSUL
      Salut, SA:MP.RO
       
      Astazi am revenit cu un gamemode.
       
      GM-UL nu este facut de mine credite: Skillz, si Bombardier.
      Din cate ati observ sunt foarte servere care au acest gm si au comenzile (LEJFASG , SI SFGSG, ) asa ca eu le am scos sper ca nu da ti cu hate ca doar atat pot..
       
      Link:http://www.mediafire.com/file/wugdyw54bdc012s/hgame_comenzi_ascunse_scoase.rar/file
      virustotal:https://www.virustotal.com/gui/file/42d2dc18f4c44451aadcbe909abc5eb542f86130b5750e498f300a6e5e2a5aa7/detection
       
      Bafta!
    • By PCGamer
      Vreau sa-mi dati comenzile care le pun in pawno sa mearga comanda /servername si /createhouse va rog urgent!!!!! daca merge va platesc-cu 10 euro,daca nu da erori
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.