/check script problem
#1

Hi,it's me again(the noob scripter lmaoo),my problem is that,i get errors from this command:
PHP код:
 CMD:check(playeridparams[])
    {
    
GetPlayerName(playerid,name,sizeof(name));
    
format(iname,sizeof(iname),"%s.ini",name);
   new 
string[2000], id;
   if(
sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"/check [PlayerID]");
        
GetPlayerName(id,name,sizeof(name));
        
format(iname,sizeof(iname),"%s.ini",name);
        new 
string1[1000], count 0;
        new 
adm=dini_Int(iname,"Admin");
        new 
vip=dini_Int(iname,"Vip");
        new 
para=para=dini_Int(iname,"Pari");
        new 
wa=dini_Int(iname,"Warns");
        new 
aw=dini_Int(iname,"AWarns");
        new 
killsw=dini_Int(iname,"Kills");
        new 
deaths=dini_Int(iname,"Deaths");
        new 
chwegei[3000];
        
strins(chwegei,"{00FF00}Admin level: {FFFFFF}%i\n",strlen(adm,chwegei));
        
strins(chwegei,"{00FF00}VIP level: {FFFFFF}%i\n",strlen(vip,chwegei));
        
strins(chwegei,"{00FF00}Money:{FFFFFF} %d\n",strlen(para,chwegei));
        
strins(chwegei,"{00FF00}Warns: {FFFFFF}%i/5\n",strlen(wa,chwegei));
        
strins(chwegei,"{00FF00}Admin Warns: {FFFFFF}%i/3\n",strlen(aw,chwegei));
        
strins(chwegei,"{00FF00}Score: {FFFFFF}%i\n",strlen(GetPlayerScore(id),chwegei));
        
strins(chwegei,"{00FF00}Kills: {FFFFFF}%i\n",strlen(killsw,chwegei));
        
strins(chwegei,"{00FF00}Deaths: {FFFFFF}%i\n",strlen(deaths,chwegei));
        new 
string2[256];
       
format(string2,sizeof(string2),"{FFFFFF}Stats for %s:"name);
      
ShowPlayerDialog(playerid,dialog_command+123,1800,DIALOG_STYLE_MSGBOX,"Express-BG CHECK",string2,string1,chwegei,"Close","");
     return 
1;
 } 
These are the errors:
PHP код:
D:\Samp\sampbg\pawno\include\sscanf.inc(203) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(2435) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(2448) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(2461) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4051) : warning 225unreachable code
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4469) : warning 209: function "OnDialogResponse" should return a value
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4763) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4793) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4823) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4853) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(4883) : warning 219local variable "name" shadows a variable at a preceding level
D
:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8070) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8071) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8072) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8073) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8074) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8075) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8076) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8077) : error 035argument type mismatch (argument 1)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8080) : error 035argument type mismatch (argument 4)
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8068) : warning 204symbol is assigned a value that is never used"deaths"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8067) : warning 204symbol is assigned a value that is never used"killsw"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8066) : warning 204symbol is assigned a value that is never used"aw"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8065) : warning 204symbol is assigned a value that is never used"wa"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8064) : warning 204symbol is assigned a value that is never used"para"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8063) : warning 204symbol is assigned a value that is never used"vip"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8062) : warning 204symbol is assigned a value that is never used"adm"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8061) : warning 204symbol is assigned a value that is never used"count"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8057) : warning 204symbol is assigned a value that is never used"string"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(8145) : warning 204symbol is assigned a value that is never used"stri"
D:\SAMP\sampbg\gamemodes\BGexpressV2.0.pwn(991) : warning 204symbol is assigned a value that is never used"pduty"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
9 Errors

If you help you will be repped!
Reply
#2

Why don't you first learn how to have a good identation in your script, and then try to create something? It's a mess bro.
Reply
#3

I recommend that you load the players' data every time they log in, so you do not have to be loading a player's data in each command.

Also learn some basic pawn tutorials so you have a little more knowledge.

PHP код:
CMD:check(playeridparams[]) 
{
    if(
sscanf(params"u"params[0])) return SendClientMessage(playerid, -1,"/check [PlayerID]"); 
    new 
P_name[MAX_PLAYER_NAME], string[90];
    
GetPlayerName(params[0], P_nameMAX_PLAYER_NAME); 
    
format(stringsizeof(string), "%s.ini"P_name); 
    
    new 
adm dini_Int(string"Admin"); 
    new 
vip dini_Int(string"Vip"); 
    new 
para dini_Int(string"Pari"); 
    new 
wa dini_Int(string"Warns"); 
    new 
aw dini_Int(string"AWarns"); 
    new 
killsw dini_Int(string"Kills"); 
    new 
deaths dini_Int(string"Deaths"); 
    
    new 
str[145], dialog[850]; 
    
format(strsizeof(str), "{00FF00}Admin level: {FFFFFF}%i\n"adm); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}VIP level: {FFFFFF}%i\n"vip); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}Money:{FFFFFF} %d\n"para); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}Warns: {FFFFFF}%i/5\n"wa); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}Admin Warns: {FFFFFF}%i/3\n"aw); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}Score: {FFFFFF}%i\n"GetPlayerScore(params[0])); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}Kills: {FFFFFF}%i\n"killsw); strcat(dialogstr);
    
format(strsizeof(str), "{00FF00}Deaths: {FFFFFF}%i\n"deaths); strcat(dialogstr);
    
ShowPlayerDialog(playeriddialog_command+123DIALOG_STYLE_MSGBOX"Express-BG CHECK"dialog"Close"""); 
    return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)