can i get help with cmds ?
#1

hello guys my firend have a problem and i couldn't fix it can you help me ?

he was trying to add /reportbug /bugs /deletebug [id] can you help me to fix ?
Note my firend using script like NGRP

or give me easier cmds cuz he took this from ZRP script

..\gamemodes\Unknown.pwn(87560) : error 017: undefined symbol "IsPlayerLoggedIn"
..\gamemodes\Unknown.pwn(87562) : error 017: undefined symbol "AntiAdv"
..\gamemodes\Unknown.pwn(87565) : error 017: undefined symbol "RPN"
..\gamemodes\Unknown.pwn(87569) : error 017: undefined symbol "RPN"
..\gamemodes\Unknown.pwn(87576) : error 017: undefined symbol "IsPlayerLoggedIn"
..\gamemodes\Unknown.pwn(87593) : error 017: undefined symbol "IsPlayerLoggedIn"
..\gamemodes\Unknown.pwn(8759 : error 017: undefined symbol "fdeleteline"
..\gamemodes\Unknown.pwn(87599) : error 017: undefined symbol "RPN"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.


CMD:reportbug(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(AntiAdv(playerid, params)) return 1;
if(strlen(params) > 12 return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128];
format(string, sizeof(string), "[%s] %s\r\n", RPN(playerid), params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}


CMD:bugs(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
new string[128], File: file = fopen("bugs.cfg", io_read), idx=1;
SendClientMessage(playerid, COLOR_ORANGE, "[City Of Roleplay Bugs]:");
while(fread(file, string))
{
format(string, sizeof(string), "%d) %s", idx, string);
SendClientMessage(playerid, COLOR_ORANGE, string);
idx ++;
}
fclose(file);
return 1;
}


CMD:deletebug(playerid, params[])
{
new line;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "i", line)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletebug [bugid]");
if(line < 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid bug id.");
new string[128];
fdeleteline("bugs.cfg", line);
format(string, sizeof(string), "AdmWarn: %s has deleted bug ID %d.", RPN(playerid), line);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}


Note my firend using script like NGRP
Reply
#2

Here it is:
pawn Код:
CMD:reportbug(playerid, params[])
{
    if(sscanf(params, "s[128]", params))
        return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");

    if(strlen(params) > 12)
        return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
       
    new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof pName);
    format(string, sizeof(string), "[%s] %s\r\n", pName, params);
    fwrite(file, string);
    fclose(file);
    SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
    format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
    SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}

CMD:bugs(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1)
        return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
       
    new string[128], File: file = fopen("bugs.cfg", io_read), idx=1;
    SendClientMessage(playerid, COLOR_ORANGE, "[City Of Roleplay Bugs]:");
    while(fread(file, string))
    {
        format(string, sizeof(string), "%d) %s", idx, string);
        SendClientMessage(playerid, COLOR_ORANGE, string);
        idx ++;
    }
    fclose(file);
    return 1;
}

CMD:deletebug(playerid, params[])
{
    new line;
    if(PlayerInfo[playerid][pAdmin] < 7)
        return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
       
    if(sscanf(params, "i", line))
        return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletebug [bugid]");
       
    if(line < 1)
        return SendClientMessage(playerid, COLOR_GREY, "Invalid bug id.");
       
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof pName);
    fdeleteline("bugs.cfg", line);
    format(string, sizeof(string), "AdmWarn: %s has deleted bug ID %d.", pName, line);
    SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}
Reply
#3

done when compiling

i got those errors

Код:
C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87570) : error 017: undefined symbol "RPN"
C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87575) : error 035: argument type mismatch (argument 2)
C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87610) : error 017: undefined symbol "fdeleteline"
C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87612) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

I edited my previous post, try to copy it again ...

Tell me what lines give you the (argument 2) error ? Post the lines ... I can't seem to figure it on my own.
Reply
#5

Eroors
Код:
C:\Users\kareem\Desktop\MaServer\gamemodes\UGRP.pwn(87594) : error 035: argument type mismatch (argument 2)
C:\Users\kareem\Desktop\MaServer\gamemodes\UGRP.pwn(87629) : error 017: undefined symbol "fdeleteline"
C:\Users\kareem\Desktop\MaServer\gamemodes\UGRP.pwn(87631) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
87594 line :

Код:
    SendAdminMessage(COLOR_DARKRED, 1, string);
87629 line :

Код:
    fdeleteline("bugs.cfg", line);
87631 line

Код:
    SendAdminMessage(COLOR_DARKRED, 1, string);
Reply
#6

Show me the
pawn Код:
SendAdminMessage
stock / function.


About the 'fdeleteline' error ... I can't help you, I have no idea how to fix that.
Reply
#7

Its this.
Код:
fdeleteline(filename[], line)
{
  new count, string[256], File:file, File:temp;

  file= fopen(filename, io_read);
  temp = fopen("tmpfile.tmp", io_write);

  while (fread(file, string))
    if (++count != line)
      fwrite(temp, string);

  fclose(file);
  fclose(temp);

  file= fopen(filename, io_write);
  temp = fopen("tmpfile.tmp", io_read);

  while (fread(temp, string))
    fwrite(file, string);
    
  fclose(file);
  fclose(temp);
  fremove("tmpfile.tmp");
}
Reply
#8

Quote:
Originally Posted by Brokenbreaken
Посмотреть сообщение
Its this.
Код:
fdeleteline(filename[], line)
{
  new count, string[256], File:file, File:temp;

  file= fopen(filename, io_read);
  temp = fopen("tmpfile.tmp", io_write);

  while (fread(file, string))
    if (++count != line)
      fwrite(temp, string);

  fclose(file);
  fclose(temp);

  file= fopen(filename, io_write);
  temp = fopen("tmpfile.tmp", io_read);

  while (fread(temp, string))
    fwrite(file, string);
    
  fclose(file);
  fclose(temp);
  fremove("tmpfile.tmp");
}
bro iam not understand can you tell me what to replace ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)