[Ajuda] erro na gamemode
#1

Bom esse rank e em include e tipo ele continua n funcionando ele atualiza no timer mais n funciona alguem que conheзe ele ajuda ae pfv nгo sei se precisa mais eu vo postar a include aki

PHP код:
//#include a_samp
//#include dof2
#define pasta_rank  "rank/rank_%s.ini"
/*
native createrank(rankname[]);
native getrank(rankname[], description[]);
native checkrank(rankname[], points);
native deleterank(rankname[]);
native resetrank(rankname[]);
*/
stock createrank(rankname[])
{
    new 
string[100];
    
format(stringsizeof stringpasta_rankrankname);
    if(!
DOF2_FileExists(string)){
        
//position 1
        
DOF2_SetString(string"name1""Ninguйm");
        
DOF2_SetInt(string"points1"0);
        
//position 2
        
DOF2_SetString(string"name2""Ninguйm");
        
DOF2_SetInt(string"points2"0);
        
//position 3
        
DOF2_SetString(string"name3""Ninguйm");
        
DOF2_SetInt(string"points3"0);
        
//position 4
        
DOF2_SetString(string"name4""Ninguйm");
        
DOF2_SetInt(string"points4"0);
        
//position 5
        
DOF2_SetString(string"name5""Ninguйm");
        
DOF2_SetInt(string"points5"0);
        
//position 6
        
DOF2_SetString(string"name6""Ninguйm");
        
DOF2_SetInt(string"points6"0);
        
//position 7
        
DOF2_SetString(string"name7""Ninguйm");
        
DOF2_SetInt(string"points7"0);
        
//position 8
        
DOF2_SetString(string"name8""Ninguйm");
        
DOF2_SetInt(string"points8"0);
        
//position 9
        
DOF2_SetString(string"name9""Ninguйm");
        
DOF2_SetInt(string"points9"0);
        
//position 10
        
DOF2_SetString(string"name10""Ninguйm");
        
DOF2_SetInt(string"points10"0);
        
//position 11 - EXTRA
        
DOF2_SetString(string"name11""Ninguйm");
        
DOF2_SetInt(string"points11"0);
        
//save
        
DOF2_SaveFile();
        
printf("#rank %s criado com sucesso"rankname);
    }
    return 
1;
}
stock resetrank(rankname[])
{
    new 
string[100];
    
format(stringsizeof stringpasta_rankrankname);
    if(
DOF2_FileExists(string)){
        
DOF2_SetString(string,         "name1""Ninguйm");
        
DOF2_SetInt(string,         "points1"0);
        
DOF2_SetString(string,         "name2""Ninguйm");
        
DOF2_SetInt(string,         "points2"0);
        
DOF2_SetString(string,         "name3""Ninguйm");
        
DOF2_SetInt(string,         "points3"0);
        
DOF2_SetString(string,         "name4""Ninguйm");
        
DOF2_SetInt(string,         "points4"0);
        
DOF2_SetString(string,         "name5""Ninguйm");
        
DOF2_SetInt(string,         "points5"0);
        
DOF2_SetString(string,         "name6""Ninguйm");
        
DOF2_SetInt(string,         "points6"0);
        
DOF2_SetString(string,         "name7""Ninguйm");
        
DOF2_SetInt(string,         "points7"0);
        
DOF2_SetString(string,         "name8""Ninguйm");
        
DOF2_SetInt(string,         "points8"0);
        
DOF2_SetString(string,         "name9""Ninguйm");
        
DOF2_SetInt(string,         "points9"0);
        
DOF2_SetString(string,         "name10""Ninguйm");
        
DOF2_SetInt(string,         "points10"0);
        
//position 11 - EXTRA
        
DOF2_SetString(string"name11""Ninguйm");
        
DOF2_SetInt(string"points11"0);
        
//save
        
DOF2_SaveFile();
        
printf("#rank %s foi resetado"rankname);
    }
    return 
1;
}
stock deleterank(rankname[])
{
    new 
string[100];
    
format(stringsizeof stringpasta_rankrankname);
    if(
DOF2_FileExists(string)){
        
DOF2_RemoveFile(file);
        
printf("#rank %s foi deletado com sucesso"rankname);
    }
    return 
1;
}
stock getrank(rankname[], description[])
{
    new 
buffer[600], file[100], string[100];
    
format(filesizeof filepasta_rankrankname);
    
//rank 1
    
format(stringsizeof string"#1: %s #%d %s\n"DOF2_GetString(file"name1"), DOF2_GetInt(file"points1"), description);
    
strcat(bufferstring);
    
//rank 2
    
format(stringsizeof string"#2: %s #%d %s\n"DOF2_GetString(file"name2"), DOF2_GetInt(file"points2"), description);
    
strcat(bufferstring);
    
//rank 3
    
format(stringsizeof string"#3: %s #%d %s\n"DOF2_GetString(file"name3"), DOF2_GetInt(file"points3"), description);
    
strcat(bufferstring);
    
//rank 4
    
format(stringsizeof string"#4: %s #%d %s\n"DOF2_GetString(file"name4"), DOF2_GetInt(file"points4"), description);
    
strcat(bufferstring);
    
//rank 5
    
format(stringsizeof string"#5: %s #%d %s\n"DOF2_GetString(file"name5"), DOF2_GetInt(file"points5"), description);
    
strcat(bufferstring);
    
//rank 6
    
format(stringsizeof string"#6: %s #%d %s\n"DOF2_GetString(file"name6"), DOF2_GetInt(file"points6"), description);
    
strcat(bufferstring);
    
//rank 7
    
format(stringsizeof string"#7: %s #%d %s\n"DOF2_GetString(file"name7"), DOF2_GetInt(file"points7"), description);
    
strcat(bufferstring);
    
//rank 8
    
format(stringsizeof string"#8: %s #%d %s\n"DOF2_GetString(file"name8"), DOF2_GetInt(file"points8"), description);
    
strcat(bufferstring);
    
//rank 9
    
format(stringsizeof string"#9: %s #%d %s\n"DOF2_GetString(file"name9"), DOF2_GetInt(file"points9"), description);
    
strcat(bufferstring);
    
//rank 10
    
format(stringsizeof string"#10: %s #%d %s\n"DOF2_GetString(file"name10"), DOF2_GetInt(file"points10"), description);
    
strcat(bufferstring);
    return 
buffer;
}
stock FixSpaces2(rankname[])
{
    new 
file[100], bool:mudanca=false;
    
format(filesizeof filepasta_rankrankname);
    new
        
name1[50],points1,
        
name2[50],points2,
        
name3[50],points3,
        
name4[50],points4,
        
name5[50],points5,
        
name6[50],points6,
        
name7[50],points7,
        
name8[50],points8,
        
name9[50],points9,
        
name10[50],points10,
        
name11[50],points11;
    
format(name1sizeof name1DOF2_GetString(file"name1"));
    
points1 DOF2_GetInt(file"points1");
    
format(name2sizeof name2DOF2_GetString(file"name2"));
    
points2 DOF2_GetInt(file"points2");
    
format(name3sizeof name3DOF2_GetString(file"name3"));
    
points3 DOF2_GetInt(file"points3");
    
format(name4sizeof name4DOF2_GetString(file"name4"));
    
points4 DOF2_GetInt(file"points4");
    
format(name5sizeof name5DOF2_GetString(file"name5"));
    
points5 DOF2_GetInt(file"points5");
    
format(name6sizeof name6DOF2_GetString(file"name6"));
    
points6 DOF2_GetInt(file"points6");
    
format(name7sizeof name7DOF2_GetString(file"name7"));
    
points7 DOF2_GetInt(file"points7");
    
format(name8sizeof name8DOF2_GetString(file"name8"));
    
points8 DOF2_GetInt(file"points8");
    
format(name9sizeof name9DOF2_GetString(file"name9"));
    
points9 DOF2_GetInt(file"points9");
    
format(name10sizeof name10DOF2_GetString(file"name10"));
    
points10 DOF2_GetInt(file"points10");
    
format(name11sizeof name11DOF2_GetString(file"name11"));
    
points11 DOF2_GetInt(file"points11");
    if(
points1 1)
    {
        
mudanca=true;
        
format(name1sizeof name1name2);points1=points2;
        
format(name2sizeof name2name3);points2=points3;
        
format(name3sizeof name3name4);points3=points4;
        
format(name4sizeof name4name5);points4=points5;
        
format(name5sizeof name5name6);points5=points6;
        
format(name6sizeof name6name7);points6=points7;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points2 1)
    {
        
mudanca=true;
        
format(name2sizeof name2name3);points2=points3;
        
format(name3sizeof name3name4);points3=points4;
        
format(name4sizeof name4name5);points4=points5;
        
format(name5sizeof name5name6);points5=points6;
        
format(name6sizeof name6name7);points6=points7;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points3 1)
    {
        
mudanca=true;
        
format(name3sizeof name3name4);points3=points4;
        
format(name4sizeof name4name5);points4=points5;
        
format(name5sizeof name5name6);points5=points6;
        
format(name6sizeof name6name7);points6=points7;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points4 1)
    {
        
mudanca=true;
        
format(name4sizeof name4name5);points4=points5;
        
format(name5sizeof name5name6);points5=points6;
        
format(name6sizeof name6name7);points6=points7;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points5 1)
    {
        
mudanca=true;
        
format(name5sizeof name5name6);points5=points6;
        
format(name6sizeof name6name7);points6=points7;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points6 1)
    {
        
mudanca=true;
        
format(name6sizeof name6name7);points6=points7;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points7 1)
    {
        
mudanca=true;
        
format(name7sizeof name7name8);points7=points8;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points8 1)
    {
        
mudanca=true;
        
format(name8sizeof name8name9);points8=points9;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points9 1)
    {
        
mudanca=true;
        
format(name9sizeof name9name10);points9=points10;
        
format(name10sizeof name10name11);points10=points11;
    }
    if(
points10 1)
    {
        
mudanca=true;
        
format(name10sizeof name10name11);points10=points11;
    }
    
    if(
mudanca)
    {
        
DOF2_SetString(file,         "name1",     name1);
        
DOF2_SetInt(file,         "points1",     points1);
        
DOF2_SetString(file,         "name2",     name2);
        
DOF2_SetInt(file,         "points2",     points2);
        
DOF2_SetString(file,         "name3",     name3);
        
DOF2_SetInt(file,         "points3",     points3);
        
DOF2_SetString(file,         "name4",     name4);
        
DOF2_SetInt(file,         "points4",     points4);
        
DOF2_SetString(file,         "name5",     name5);
        
DOF2_SetInt(file,         "points5",     points5);
        
DOF2_SetString(file,         "name6",     name6);
        
DOF2_SetInt(file,         "points6",     points6);
        
DOF2_SetString(file,         "name7",     name7);
        
DOF2_SetInt(file,         "points7",     points7);
        
DOF2_SetString(file,         "name8",     name8);
        
DOF2_SetInt(file,         "points8",     points8);
        
DOF2_SetString(file,         "name9",     name9);
        
DOF2_SetInt(file,         "points9",     points9);
        
DOF2_SetString(file,         "name10",     name10);
        
DOF2_SetInt(file,         "points10",     points10);
        
DOF2_SaveFile();
    }
    return 
1;
}
stock removenamerank(rankname[], removename[])
{
    new 
file[100], name[15], points[15], bool:temnick=false;
    
format(filesizeof filepasta_rankrankname);
    for(new 
i=111i++)
    {
        
format(namesizeof name"name%d"i);
        
format(pointssizeof points"points%d"i);
        if(!
strcmp(removenameDOF2_GetString(filename), true)){
        
            
temnick=true;
            
DOF2_SetString(file,         name"Ninguйm");
            
DOF2_SetInt(file,             points0);
            break;
        }
    }
    if(
temnick){
        
DOF2_SaveFile();
    }
    return 
1;
}
stock checkrank(rankname[], name[], points)
{
    new 
string[100];
    
format(stringsizeof stringpasta_rankrankname);
    
removenamerank(ranknamename);
    new
        
name1[50],points1,
        
name2[50],points2,
        
name3[50],points3,
        
name4[50],points4,
        
name5[50],points5,
        
name6[50],points6,
        
name7[50],points7,
        
name8[50],points8,
        
name9[50],points9,
        
name10[50],points10,
        
name11[50],points11;
    
format(name1sizeof name1DOF2_GetString(string"name1"));
    
points1 DOF2_GetInt(string"points1");
    
format(name2sizeof name2DOF2_GetString(string"name2"));
    
points2 DOF2_GetInt(string"points2");
    
format(name3sizeof name3DOF2_GetString(string"name3"));
    
points3 DOF2_GetInt(string"points3");
    
format(name4sizeof name4DOF2_GetString(string"name4"));
    
points4 DOF2_GetInt(string"points4");
    
format(name5sizeof name5DOF2_GetString(string"name5"));
    
points5 DOF2_GetInt(string"points5");
    
format(name6sizeof name6DOF2_GetString(string"name6"));
    
points6 DOF2_GetInt(string"points6");
    
format(name7sizeof name7DOF2_GetString(string"name7"));
    
points7 DOF2_GetInt(string"points7");
    
format(name8sizeof name8DOF2_GetString(string"name8"));
    
points8 DOF2_GetInt(string"points8");
    
format(name9sizeof name9DOF2_GetString(string"name9"));
    
points9 DOF2_GetInt(string"points9");
    
format(name10sizeof name10DOF2_GetString(string"name10"));
    
points10 DOF2_GetInt(string"points10");
    
format(name11sizeof name11DOF2_GetString(string"name11"));
    
points11 DOF2_GetInt(string"points11");
    if(
points points1)
    {
        
DOF2_SetString(string,         "name2",     name1);
        
DOF2_SetInt(string,         "points2",     points1);
        
DOF2_SetString(string,         "name3",     name2);
        
DOF2_SetInt(string,         "points3",     points2);
        
DOF2_SetString(string,         "name4",     name3);
        
DOF2_SetInt(string,         "points4",     points3);
        
DOF2_SetString(string,         "name5",     name4);
        
DOF2_SetInt(string,         "points5",     points4);
        
DOF2_SetString(string,         "name6",     name5);
        
DOF2_SetInt(string,         "points6",     points5);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
//set rank
        
DOF2_SetString(string,         "name1",     name);
        
DOF2_SetInt(string,         "points1",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points2)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name3",     name2);
        
DOF2_SetInt(string,         "points3",     points2);
        
DOF2_SetString(string,         "name4",     name3);
        
DOF2_SetInt(string,         "points4",     points3);
        
DOF2_SetString(string,         "name5",     name4);
        
DOF2_SetInt(string,         "points5",     points4);
        
DOF2_SetString(string,         "name6",     name5);
        
DOF2_SetInt(string,         "points6",     points5);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name2",     name);
        
DOF2_SetInt(string,         "points2",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points3)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name4",     name3);
        
DOF2_SetInt(string,         "points4",     points3);
        
DOF2_SetString(string,         "name5",     name4);
        
DOF2_SetInt(string,         "points5",     points4);
        
DOF2_SetString(string,         "name6",     name5);
        
DOF2_SetInt(string,         "points6",     points5);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name3",     name);
        
DOF2_SetInt(string,         "points3",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points4)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name5",     name4);
        
DOF2_SetInt(string,         "points5",     points4);
        
DOF2_SetString(string,         "name6",     name5);
        
DOF2_SetInt(string,         "points6",     points5);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name4",     name);
        
DOF2_SetInt(string,         "points4",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points5)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name6",     name5);
        
DOF2_SetInt(string,         "points6",     points5);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name5",     name);
        
DOF2_SetInt(string,         "points5",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points6)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name6",     name);
        
DOF2_SetInt(string,         "points6",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points6)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name7",     name6);
        
DOF2_SetInt(string,         "points7",     points6);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name6",     name);
        
DOF2_SetInt(string,         "points6",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points7)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name8",     name7);
        
DOF2_SetInt(string,         "points8",     points7);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name7",     name);
        
DOF2_SetInt(string,         "points7",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points8)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name9",     name8);
        
DOF2_SetInt(string,         "points9",     points8);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name8",     name);
        
DOF2_SetInt(string,         "points8",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points9)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name10",     name9);
        
DOF2_SetInt(string,         "points10",    points9);
        
DOF2_SetString(string,         "name9",     name);
        
DOF2_SetInt(string,         "points9",     points);
        
//save
        
DOF2_SaveFile();
    }
    else if(
points points10)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name10",     name);
        
DOF2_SetInt(string,         "points10"points);
        
//save
        
DOF2_SaveFile();
    }
    
    
//Extra
    
else if(points points11)
    {
        
//removenamerank(rankname, name);
        
DOF2_SetString(string,         "name11",     name);
        
DOF2_SetInt(string,         "points11"points);
        
//save
        
DOF2_SaveFile();
    }
    
FixSpaces2(rankname);
    return 
1;

Reply
#2

Isso nгo й um timer, isso й uma public (creio eu), Que o timer usarб essa funзгo bote em OnGameModeInit:

Код:
SetTimer("AtualizarRank", Tempo em Milisegundos, Repetir se sim TRUE se nгo FALSE);
Verifique se vocк tem a include foreach
Creio eu vocк pegou da gm do BPF, entгo nela tem #define BPS:: public ( e nгo reconheceu tente trocar para public)

Verifique que tem todas essas variaveis: psMats, pKill. em uma enum
Reply
#3

troquei para public deu isso aqui public function lacks forward declaration (symbol "AtualizarRank")
Reply
#4

Vocк e seus double-post, existe uma funзгo chamada edit !
Reply
#5

mlz passa link das regras ae
Reply
#6

Creio eu, essa gm da net, porque vocк nгo procura o que estб faltando na original, com certeza vocк deve ter mexido em algo.
Reply
#7

Quote:
Originally Posted by NiGhA
Посмотреть сообщение
Vocк e seus double-post, existe uma funзгo chamada edit !
Quote:
Originally Posted by didimk157
Посмотреть сообщение
mlz passa link das regras ae

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)