Problem in gamemode
#1

Hello everybody,
I tried to fix this code but I have a lot of problems with it, I would like to get help how to fix it.
my errors are:
pawn Код:
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31692) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31754) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31806) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31843) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31856) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31869) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31880) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31897) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31908) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31925) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(31955) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32019) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32053) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32073) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32113) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32147) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32167) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32188) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32200) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32268) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32268) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32273) : warning 219: local variable "temp" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32314) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32324) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32338) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : warning 219: local variable "fdeleteline" shadows a variable at a preceding level
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : error 001: expected token: ";", but found "("
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : error 017: undefined symbol "idx"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : warning 215: expression has no effect
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32477) : error 012: invalid function call, not a valid address
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32477) : warning 215: expression has no effect
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32477) : warning 215: expression has no effect
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32477) : error 001: expected token: ";", but found ")"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32477) : error 029: invalid expression, assumed zero
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32477) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
my code is:
pawn Код:
CMD:phchange(playerid, params[])
{
    new string[128], number, File:file = fopen("cellphones.cfg", io_read), fdeleteline(("cellphones.cfg", idx[]));
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pHasCellphone]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a cellphone yet.");
    if(!IsPlayerInRangeOfPoint(playerid, 2, 1228.9281,-737.9149,1088.6360)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the cityhall.");
    if(sscanf(params, "i", number)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /phchange [desired number]");
    if(number < -1) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == -1) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 0) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 1) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 2) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 3) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 4) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 5) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 6) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 8) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 9) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 10) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 11) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 12) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 13) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 14) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 15) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 16) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 17) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 18) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 19) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 20) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 21) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 22) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 23) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 24) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 25) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 26) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 27) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 28) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 29) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 30) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 31) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 32) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 33) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 34) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 35) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 36) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 37) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 38) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 39) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 40) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 41) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 42) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 43) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 44) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 45) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 46) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 47) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 48) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 49) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 50) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 50) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 51) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 52) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 53) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 54) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 55) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 56) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 57) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 58) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 59) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 60) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 61) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 62) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 63) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 64) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 65) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 66) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 67) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 68) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 69) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 70) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 71) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 72) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 73) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 74) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 75) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 76) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 77) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 78) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 79) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 80) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 81) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 82) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 83) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 84) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 85) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 86) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 87) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 89) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 90) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 91) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 91) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 92) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 93) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 94) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 95) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 96) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 97) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 98) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number == 99) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(number > 99999999999) return SendClientMessage(playerid, COLOR_GREY, "Your number can't be low than 100 and more than 99999999999");
    if(PlayerInfo[playerid][pNumber] == number) return SendClientMessage(playerid, COLOR_GREY, "You already have this phone number.");
    new idx = 1;
    while(fread(file, string))
    {
        if(strval(string) == number) return SendClientMessage(playerid, COLOR_GREY, "This number is already registered.");
        if(strval(string) == PlayerInfo[playerid][pNumber])
        {
            fdeleteline("cellphones.cfg", idx);
        }
        idx ++;
        return 1;
    }
    fclose(file);
    file = fopen("cellphones.cfg", io_append);
    format(string, sizeof(string), "%d\r\n", number);
    fwrite(file, string);
    fclose(file);
    if(!PlayerInfo[playerid][pNumber])
    {
        SendClientMessage(playerid, COLOR_WHITE, " You have changed your Phone Number for free as it's the first time.");
    }
    else
    {
        GiveDodMoney(playerid, PlayerInfo[playerid][pLevel] * -1200);
        TaxMoney += 500;
        format(string, sizeof(string), " You've changed your number and you've been charged $%d.", PlayerInfo[playerid][pLevel] * -1200);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    PlayerInfo[playerid][pNumber] = number;
    return 1;
}
Please help me to fix it.

And I have this stock that makes the warnings:

pawn Код:
stock 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
#2

You gave me a cancer with all those if's.....

PHP код:
CMD:phchange(playeridparams[])
{
    new 
string[128], numberFile:file fopen("cellphones.cfg"io_read), fdeleteline(("cellphones.cfg"idx[]));
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
PlayerInfo[playerid][pHasCellphone]) return SendClientMessage(playeridCOLOR_GREY"You don't own a cellphone yet.");
    if(!
IsPlayerInRangeOfPoint(playerid21228.9281,-737.9149,1088.6360)) return SendClientMessage(playeridCOLOR_GREY"You are not at the cityhall.");
    if(
sscanf(params"i"number)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /phchange [desired number]");
    if(
number < -|| number 99999999999) return SendClientMessage(playeridCOLOR_GREY"Your number can't be low than 100 and more than 99999999999");
    if(
PlayerInfo[playerid][pNumber] == number) return SendClientMessage(playeridCOLOR_GREY"You already have this phone number.");
    new 
idx 1;
    while(
fread(filestring))
    {
        if(
strval(string) == number) return SendClientMessage(playeridCOLOR_GREY"This number is already registered.");
        if(
strval(string) == PlayerInfo[playerid][pNumber])
        {
            
fdeleteline("cellphones.cfg"idx);
        }
        
idx ++;
        return 
1;
    }
    
fclose(file);
    
file fopen("cellphones.cfg"io_append);
    
format(stringsizeof(string), "%d\r\n"number);
    
fwrite(filestring);
    
fclose(file);
    if(!
PlayerInfo[playerid][pNumber])
    {
        
SendClientMessage(playeridCOLOR_WHITE" You have changed your Phone Number for free as it's the first time.");
    }
    else
    {
        
GiveDodMoney(playeridPlayerInfo[playerid][pLevel] * -1200);
        
TaxMoney += 500;
        
format(stringsizeof(string), " You've changed your number and you've been charged $%d."PlayerInfo[playerid][pLevel] * -1200);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    
PlayerInfo[playerid][pNumber] = number;
    return 
1;

Also try renaming one of strings (in cmd or stock) to string1.
Reply
#3

Quote:
Originally Posted by iLearner
Посмотреть сообщение
You gave me a cancer with all those if's.....

PHP код:
CMD:phchange(playeridparams[])
{
    new 
string[128], numberFile:file fopen("cellphones.cfg"io_read), fdeleteline(("cellphones.cfg"idx[]));
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
PlayerInfo[playerid][pHasCellphone]) return SendClientMessage(playeridCOLOR_GREY"You don't own a cellphone yet.");
    if(!
IsPlayerInRangeOfPoint(playerid21228.9281,-737.9149,1088.6360)) return SendClientMessage(playeridCOLOR_GREY"You are not at the cityhall.");
    if(
sscanf(params"i"number)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /phchange [desired number]");
    if(
number < -|| number 99999999999) return SendClientMessage(playeridCOLOR_GREY"Your number can't be low than 100 and more than 99999999999");
    if(
PlayerInfo[playerid][pNumber] == number) return SendClientMessage(playeridCOLOR_GREY"You already have this phone number.");
    new 
idx 1;
    while(
fread(filestring))
    {
        if(
strval(string) == number) return SendClientMessage(playeridCOLOR_GREY"This number is already registered.");
        if(
strval(string) == PlayerInfo[playerid][pNumber])
        {
            
fdeleteline("cellphones.cfg"idx);
        }
        
idx ++;
        return 
1;
    }
    
fclose(file);
    
file fopen("cellphones.cfg"io_append);
    
format(stringsizeof(string), "%d\r\n"number);
    
fwrite(filestring);
    
fclose(file);
    if(!
PlayerInfo[playerid][pNumber])
    {
        
SendClientMessage(playeridCOLOR_WHITE" You have changed your Phone Number for free as it's the first time.");
    }
    else
    {
        
GiveDodMoney(playeridPlayerInfo[playerid][pLevel] * -1200);
        
TaxMoney += 500;
        
format(stringsizeof(string), " You've changed your number and you've been charged $%d."PlayerInfo[playerid][pLevel] * -1200);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    
PlayerInfo[playerid][pNumber] = number;
    return 
1;

I have those errors:
PHP код:
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32361) : warning 219local variable "fdeleteline" shadows a variable at a preceding level
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32361) : error 001expected token";"but found "("
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32361) : error 017undefined symbol "idx"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32361) : warning 215expression has no effect
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32369) : error 017undefined symbol "string"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32374) : error 012invalid function callnot a valid address
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32374) : warning 215expression has no effect
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32374) : warning 215expression has no effect
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32374) : error 001expected token";"but found ")"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32374) : error 029invalid expressionassumed zero
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32374) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
7 Errors

Reply
#4

show me the line 32361 & 32374 & 32369 (lines where it gives errors)
Reply
#5

Quote:
Originally Posted by iLearner
Посмотреть сообщение
show me the line 32361 & 32374 & 32369 (lines where it gives errors)
line 32361:
PHP код:
new string1[128], numberFile:file fopen("cellphones.cfg"io_read), fdeleteline(("cellphones.cfg"idx[])); 
line 32374:
PHP код:
fdeleteline("cellphones.cfg"idx); 
line 32369:
PHP код:
while(fread(filestring1)) 
Reply
#6

new string1[128], number, File:file = fopen("cellphones.cfg", io_read), fdeleteline(("cellphones.cfg", idx[]));

change to:

new string1[128], number, File:file;
file = fopen("cellphones.cfg", io_read), fdeleteline("cellphones.cfg", idx[]);
Reply
#7

Quote:
Originally Posted by iLearner
Посмотреть сообщение
new string1[128], number, File:file = fopen("cellphones.cfg", io_read), fdeleteline(("cellphones.cfg", idx[]));

change to:

new string1[128], number, File:file;
file = fopen("cellphones.cfg", io_read), fdeleteline("cellphones.cfg", idx[]);
I have this error and warnings:
PHP код:
\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(32362) : error 017undefined symbol "idx"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50281) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50281) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50281) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50281) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50310) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50310) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50310) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50310) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50339) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50339) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50339) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50339) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50368) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50368) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50368) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50368) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50397) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50397) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50397) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(50397) : warning 202number of arguments does not match definition
C
:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(84177) : warning 203symbol is never used"VehicleNames"
C:\Users\liorl\Desktop\FTPBackupNRP\gamemodes\CWRP.pwn(84177) : warning 203symbol is never used"vehName"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

how can I fix it?
Reply
#8

Can someone help me please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)