Jump to content
  • 0

Problema comanda /color


VladA13D

Question

Problema intalnita (descriere): Nu functioneaza...primesc mai multe erori,si daca le rezolv nu functioneaza cum trebuie.
Ero(area / rile) / warning-(ul / urile):

 

: error 017: undefined symbol "idx"

 : error 037: invalid string (possibly non-terminated string)
: error 017: undefined symbol "Ti"
 error 017: undefined symbol "schimbat"
: fatal error 107: too many error messages on one line

Liniile de cod / sursa / script-ul: 

 

 

if(strcmp(cmd, "/c", true) == 0 || strcmp(cmd, "/color", true) == 0)
    {
     if(IsPlayerConnected(playerid))
     {
     new x_nr[64];
     x_nr = strtok(cmdtext, idx);
     if(!strlen(x_nr))
     {
     SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
     return 1;
     }
     if(strcmp(x_nr,"blue",true) == 0)
     {
     SetPlayerColor(playerid, 0x2641FEAA);
     SendClientMessage(playerid, 0xFFFFFF, "Ti-ai schimbat culoarea cu succes ! Acum esti albastru .);
            }
            else
     {
     SendClientMessage(playerid, 0xFF0000, "
USAGE: /color [culoare]");
     return 1;
     }
     }
     return 1;
    }

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da,dar nu ma descurc cu strtok.

Edited by VladA13D
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

if(strcmp(cmd, "/c", true) == 0 || strcmp(cmd, "/color", true) == 0)
    {
   if(IsPlayerConnected(playerid))
   {
   new x_nr[64];
   x_nr = strtok(cmdtext, idx);
   if(!strlen(x_nr))
   {
   SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
   return 1;
   }
   if(strcmp(x_nr,"blue",true) == 0)
   {
   SetPlayerColor(playerid, 0x2641FEAA);
   SendClientMessage(playerid, 0xFFFFFF, "Ti-ai schimbat culoarea cu succes ! Acum esti albastru .");
            }
            else
   {
   SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
   return 1;
   }
   }
   return 1;
    }

 

 

Link to comment
Share on other sites

  • 0
if(strcmp(cmd, "/c", true) == 0 || strcmp(cmd, "/color", true) == 0)
    {
   if(IsPlayerConnected(playerid))
   {
   new x_nr[64];
   x_nr = strtok(cmdtext, idx);
   if(!strlen(x_nr))
   {
   SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
   return 1;
   }
   if(strcmp(x_nr,"blue",true) == 0)
   {
   SetPlayerColor(playerid, 0x2641FEAA);
   SendClientMessage(playerid, 0xFFFFFF, "Ti-ai schimbat culoarea cu succes ! Acum esti albastru .");
            }
            else
   {
   SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
   return 1;
   }
   }
   return 1;
    }

 

error 017: undefined symbol "cmd"

error 017: undefined symbol "idx"
Link to comment
Share on other sites

  • 0
if(strcmp(cmd, "/c", true) == 0 || strcmp(cmd, "/color", true) == 0)
    {
   if(IsPlayerConnected(playerid))
   {
   new x_nr[64];
   new idx;
   x_nr = strtok(cmdtext, idx);
   if(!strlen(x_nr))
   {
   SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
   return 1;
   }
   if(strcmp(x_nr,"blue",true) == 0)
   {
   SetPlayerColor(playerid, 0x2641FEAA);
   SendClientMessage(playerid, 0xFFFFFF, "Ti-ai schimbat culoarea cu succes ! Acum esti albastru .");
            }
            else
   {
   SendClientMessage(playerid, 0xFF0000, "USAGE: /color [culoare]");
   return 1;
   }
   }
   return 1;

Iar pentru 'cmd' cauta functia OnPlayerCommandPerformed si pune acolo:

new cmd[256];
qua8n0lrq5wl5v5xccbk.png
 
mf79y6bvavi9sp2qqfoi.png
Contact: Mail: [email protected]
Y!M: r3mus.onlypro
Skype: r3mus.onlypro
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.