need help for command
#1

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;
    }
Reply
#2

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;
    }
Reply
#3

Код:
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;
    }
Reply


Forum Jump:


Users browsing this thread: