Szerző Téma: mi a gond a kódban?  (Megtekintve 749 alkalommal)

dexi

  • Vendég
mi a gond a kódban?
« Dátum: 2011. november 12. - 22:28:18 »
0 Show voters
[pawn]//----------------------------------[ADMINAD]------------------------------------------------
if(strcmp(cmd, \"/adminad\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {   new tmp[25];
            tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, YELLOW, \"HASZNÁL: /adminad [iD/Név] [szint(1-2)]\");
         return 1;
      }
      new para1;
      new level;
      para1 = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
      level = strval(tmp);
      if(PlayerInfo[playerid][pAdmin] >= 2)
      {
          if(IsPlayerConnected(para1))
          {
              if(para1 != INVALID_PLAYER_ID)
              {
               GetPlayerName(para1, GivePlayer, sizeof(GivePlayer));
               GetPlayerName(playerid, sendername, sizeof(sendername));
               PlayerInfo[para1][pAdmin] = level;
               printf(\"Aüzenet: %s kinevezte %s szint: %d adminnak.\", sendername, giveplayer, level);
               format(string, sizeof(string), \" %d admint kaptál tõle: %s\", level, sendername);
               SendClientMessage(para1, COLOR_WHITE, string);
               format(string, sizeof(string), \"   Kinevezted %s szint: %d adminnak.\", giveplayer,level);
               SendClientMessage(playerid, COLOR_WHITE, string);
            }
         }
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, \"   Nem vagy Tulaj!\");
      }
   }
   return 1;
}[/pawn]
 
D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(367) : error 017: undefined symbol \"GivePlayer\"
D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(367) : error 017: undefined symbol \"GivePlayer\"
D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(367) : error 029: invalid expression, assumed zero
D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(367) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
4 Errors.


 
Mi a megoldás?:S Mi lehet a baja?

mi a gond a kódban?
« Válasz #1 Dátum: 2011. november 12. - 23:25:17 »
0 Show voters
[pawn]//----------------------------------[ADMINAD]------------------------------------------------
if(strcmp(cmd, \"/adminad\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {   new tmp[25];
            tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, YELLOW, \"HASZNÁL: /adminad [iD/Név] [szint(1-2)]\");
         return 1;
      }
      new para1;
      new level;
      para1 = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
      level = strval(tmp);
      if(PlayerInfo[playerid][pAdmin] >= 2)
      {
          if(IsPlayerConnected(para1))
          {
              if(para1 != INVALID_PLAYER_ID)
              {
                                                                                    new GivePlayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME];
               GetPlayerName(para1, GivePlayer, sizeof(GivePlayer));
               GetPlayerName(playerid, sendername, sizeof(sendername));
               PlayerInfo[para1][pAdmin] = level;
               printf(\"Aüzenet: %s kinevezte %s szint: %d adminnak.\", sendername, GivePlayer, level);
               format(string, sizeof(string), \" %d admint kaptál tõle: %s\", level, sendername);
               SendClientMessage(para1, COLOR_WHITE, string);
               format(string, sizeof(string), \"   Kinevezted %s szint: %d adminnak.\", GivePlayer, level);
               SendClientMessage(playerid, COLOR_WHITE, string);
            }
         }
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, \"   Nem vagy Tulaj!\");
      }
   }
   return 1;
}[/pawn]

dexi

  • Vendég
mi a gond a kódban?
« Válasz #2 Dátum: 2011. november 13. - 00:05:29 »
0 Show voters
[pawn]D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(545) : error 017: undefined symbol \"i\"
D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(545) : error 017: undefined symbol \"i\"
D:\\Games\\SAMP\\gamemodes\\BorgoreDM.pwn(713) : error 021: symbol already defined: \"strtok\"[/pawn]

]XziBiT[

  • Vendég
mi a gond a kódban?
« Válasz #3 Dátum: 2011. november 13. - 01:21:06 »
0 Show voters
Szerintem ez az eggyik error!
Ez hiányzik:
 
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \')) { index++; }
new offset = index; new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{ result[index - offset] = string[index]; index++; }
result[index - offset] = EOS; return result;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal