SA-MP Forums Archive
need help for 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: need help for command (/showthread.php?tid=427592)



need help for command - MrTinder - 02.04.2013

Hi.I'm converting my gangwars mode command to zcmd.I wanna to convert this command now
pawn Код:
if (strcmp(cmd, "/radio", true) == 0)
    {
        if(PlayerInfo[playerid][Radio] == 1)
        {
          new radio[0x24];
          radio = strtok(cmdtext, idx);
          if(!strlen(radio))
          {
            SendClientMessage(playerid,COLOR_RED,"Radio: Test");
            return 1;
          }
          if(strcmp(radio, "test", true) == 0)
          {
            PlayerInfo[playerid][pRadio] = 1;
            SendClientMessage(playerid,COLOR_GREEN,"You start radio "test".");
            SendClientMessage(playerid,COLOR_RED,"You can stop it with /radio off");
            PlayAudioStreamForPlayer(playerid,"...");
          }
          if(strcmp(radio, "off", true) == 0)
          {
            PlayerInfo[playerid][pRadio] = 0;
            SendClientMessage(playerid,COLOR_GREEN,"You stop radio.");
            StopAudioStreamForPlayer(playerid);
          }
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You didn't have radio!");
        }
        return 1;
    }



Re: need help for command - MattyG - 02.04.2013

pawn Код:
CMD:radio(playerid, params[])
    {
        if(PlayerInfo[playerid][Radio])
        {
          new radio[128];
          radio = params;
          if(!strlen(radio))
          {
            SendClientMessage(playerid,COLOR_RED,"Radio: Test");
            return 1;
          }
          if(!strcmp(radio, "test", true))
          {
            PlayerInfo[playerid][pRadio] = 1;
            SendClientMessage(playerid,COLOR_GREEN,"You start radio "test".");
            SendClientMessage(playerid,COLOR_RED,"You can stop it with /radio off");
            PlayAudioStreamForPlayer(playerid,"...");
          }
          if(!strcmp(radio, "off", true))
          {
            PlayerInfo[playerid][pRadio] = 0;
            SendClientMessage(playerid,COLOR_GREEN,"You stop radio.");
            StopAudioStreamForPlayer(playerid);
          }
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You didn't have radio!");
        }
        return 1;
    }



AW: need help for command - Blackazur - 02.04.2013

Код:
CMD:radio(playerid,params[])
    {
        if(PlayerInfo[playerid][Radio] == 1)
        {
          new radio[0x24];
          radio = strtok(cmdtext, idx);
          if(!strlen(radio))
          {
            SendClientMessage(playerid,COLOR_RED,"Radio: Test");
            return 1;
          }
          if(strcmp(radio, "test", true) == 0)
          {
            PlayerInfo[playerid][pRadio] = 1;
            SendClientMessage(playerid,COLOR_GREEN,"You start radio "test".");
            SendClientMessage(playerid,COLOR_RED,"You can stop it with /radio off");
            PlayAudioStreamForPlayer(playerid,"...");
          }
          if(strcmp(radio, "off", true) == 0)
          {
            PlayerInfo[playerid][pRadio] = 0;
            SendClientMessage(playerid,COLOR_GREEN,"You stop radio.");
            StopAudioStreamForPlayer(playerid);
          }
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You didn't have radio!");
        }
        return 1;
    }