[pomoc]/S

Započeo ‹Fox›, Oktobar 06, 2010, 14:58:46 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

imam problem sa komandom /s ja kad ukucam prvi put samo /s posalje "stjepan urla: /s" kad drugi put upisem samo /s onda mi kaze "koristiti:/s text" ja onda upisem /s text i nista se ne dogadja

if(strcmp(cmdtext, "/shout", true) == 0 || strcmp(cmdtext, "/s", true) == 0) // Modded By CuervO_NegrO
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "** Nisi ulogiran !");
            return 1;
        }
        if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
return 1;
}

new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/s)hout [local chat]");
return 1;
}
new msg[128];
new playername[24];
GetPlayerName(playerid, playername, sizeof(playername));
format(msg,sizeof(msg), "%s urla: %s !!", playername, result);
ProxDetector(30.0, playerid, msg,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 1;
}

Evo kako je kod mene xD
//----------------------------------[Shout]-----------------------------------------------
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
           return 1;
       }
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/s)hout [local chat]");
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "Sranger Shouts: %s!!", result);
}
else
{
format(string, sizeof(string), "%s Shouts: %s!!", sendername, result);
}
ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("%s", string);
}
return 1;
}

Poslednja Izmena: Oktobar 06, 2010, 15:05:51 POSLE PODNE od gonss.pwn

kad si kopiram tu komandu onda ima 5 errora pa moram sredit te errore i onda komanda ispadne ovako:
   if(strcmp(cmdtext, "/shout", true) == 0 || strcmp(cmdtext, "/s", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(gPlayerLogged[playerid] == 0)
           {
               SendClientMessage(playerid, COLOR_GREY, "   Niste logirani !");
               return 1;
           }
           new sendername[24];
         GetPlayerName(playerid, sendername, sizeof(sendername));
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[64];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/s)hout [local chat]");
            return 1;
         }
         if(PlayerInfo[playerid][pMaskuse] == 1)
         {
         new string[128];
            format(string, sizeof(string), "Sranger Shouts: %s!!", result);
         }
         else
         {
               new string[128];
            format(string, sizeof(string), "%s Shouts: %s!!", sendername, result);
         }
               new string[128];
         ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
         printf("%s", string);
      }
      return 1;
   }


i opet neradi

Ubaci ovo
//----------------------------------[Shout]-----------------------------------------------
    if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0) // Modded By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
                return 1;
            }
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
                return 1;
            }

            new y,m,d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/s)hout [local chat]");
                return 1;
            }
            if(PlayerInfo[playerid][pAdminDuty] == 1)
            {
                format(string, sizeof(string), "Admin Shouts: %s !!", result);
                SetPlayerChatBubble(playerid, string, COLOR_NICERED, 30.0, 8000);
                ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Admin Shout): %s",d,m,y,h,mi,s, sendername, result);
                ChatLog(string);
            }
            if(PlayerInfo[playerid][pMaskuse] == 1 && PlayerInfo[playerid][pAdminDuty] == 0)
            {
                format(string, sizeof(string), "Nepoznat galami: %s !!", result);
                SetPlayerChatBubble(playerid, string, COLOR_WHITE, 30.0, 8000);
                ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Masked Shout): %s",d,m,y,h,mi,s, sendername, result);
                ChatLog(string);
            }
            if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 0)
            {
                format(string, sizeof(string), "%s galami: %s !!", sendername, result);
                SetPlayerChatBubble(playerid, string, COLOR_WHITE, 30.0, 8000);
                ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Shout): %s",d,m,y,h,mi,s, sendername, result);
                ChatLog(string);
            }
            if (PlayerInfo[playerid][pAchievement1] == 0)
            {
                ShowPlayerDialog(playerid,501,DIALOG_STYLE_MSGBOX,"Achievements:\n I Can Shout (1)","Cestitamo, You have Achieved The 'I Can Shout' Badge! \n You Won 100$","Okay","Cancel");
                SafeGivePlayerMoney(playerid,100);
                PlayerInfo[playerid][pAchievement1] = 1;
            }
        }
        return 1;
    }

uvjek kad mi neko daje neku komandu uvjek stavi "cmd" a meni hoce samo ak je "cmdtext"
error 017: undefined symbol "cmd"