Problem /clans
#1

I have a problem whit clans sistem...
Код:
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11835) : error 035: argument type mismatch (argument 1)
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11835) : error 035: argument type mismatch (argument 1)
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11836) : error 028: invalid subscript (not an array or too many subscripts): "cNameclans"
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11836) : warning 215: expression has no effect
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11836) : error 001: expected token: ";", but found "]"
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11836) : error 029: invalid expression, assumed zero
C:\Users\User\Documents\ValoareCuK\gamemodes\rworld.pwn(11836) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
and
Код:
        if(dialogid == DIALOG_CREATE_CLAN)
    {
        if(!response) { return 1; }
        else
        {
            if(strlen(inputtext) > 20 || strlen(inputtext) < 3) return SCM(playerid, -1, "{008BC7}Informatie: {ffffff}Numele clanului nu poate fi mai scurt de 3 caractere sau mai lung de 20.");
              format(cNameclans, sizeof(string), 20, "%s", inputtext);
            new verificaClan = MySQLCheckClan( cNameclans[playerid] );
            if(verificaClan != 0) return SCM(playerid, -1, "{008BC7}Informatie: {ffffff}Un clan cu acest nume exista deja in baza de date.");
            format(string, sizeof(string), "{008BC7}Numele clanului a fost setat in %s.{ffffff}\nAcum, trebuie sa setezi si un tag ( minim 2 caractere, maxim 5 ).", cNameclans[playerid] );
            ShowPlayerDialog(playerid, DIALOG_CREATE_TAG + 1, DIALOG_STYLE_INPUT, "{008BC7}UNNIC Shop: {ffffff}Clan create:", string, "Next", "Close");
        }
    }
    if(dialogid == DIALOG_CREATE_TAG + 1)
    {
        if( !response ) { return 1; }
        new ID, cNameclans[50], cTag[50];
        if(strlen(inputtext) > 5 || strlen(inputtext) < 2) return SCM(playerid, -1, "{008BC7}Informatie: {ffffff}TAG-ul clanului nu poate fi mai scurt de 2 caractere sau mai lung de 5.");
        gszString[ 0 ] = EOS;
        new verificaClanTag = MySQLCheckTag( inputtext );
        if(verificaClanTag != 0) return SCM(playerid, -1, "{008BC7}Informatie: {ffffff}Un clan are deja acest TAG.");

        mysql_real_escape_string(inputtext, cTag);
        mysql_real_escape_string(cNameclans[playerid], CreateClanName);
        format( gszString, 150, "INSERT INTO `clans` (`NameClans`, `ClanTag`, `ClanSlots`, `ClanChatColor`) VALUES ('%s', '%s', 5, 1)", cNameclans, cTag);
        mysql_query( handle, gszString );
        clanID = cache_insert_id( handle );
        format( C_DATA[ ID ][ cName ], 30, CreateClanName[playerid] );
        format( C_DATA[ ID ][ cTag ], 30, inputtext );
        C_DATA[ ID ][ cSlots ] = 5;
        cRankN[ ID ][ 0 ] = "Membru";
        cRankN[ ID ][ 1 ] = "Membru";
        cRankN[ ID ][ 2 ] = "Membru";
        cRankN[ ID ][ 3 ] = "Membru";
        cRankN[ ID ][ 4 ] = "Membru";
        cRankN[ ID ][ 5 ] = "Co-Owner";
        cRankN[ ID ][ 6 ] = "Owner";
        C_DATA[ ID ][ cChatColor ] = 1;
        format( gszString, 128, "* {008BC7}Real-World Shop: {ffffff}Clanul %s [%d] a fost creat cu succes. Din cont ti-au fost retrase 100 PP.", C_DATA[ ID ][ cNameclans ], ID );
        SendClientMessage( playerid, -1, gszString );

        PlayerInfo[playerid][pPPoints] -= 25;
        Update(playerid, pPPointsu);
        
        TotalClansCreated ++
    }
Код HTML:
11835

              format(cNameclans, sizeof(string), 20, "%s", inputtext);

11836

    new verificaClan = MySQLCheckClan( cNameclans[playerid] );
Reply
#2

Код:
format(cNameclans, 20, "%s", inputtext);
The parameters of format are: (output[], len, const format[], {Float,_}:...)

You don't need "sizeof(string)".
Reply
#3

C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11835) : error 035: argument type mismatch (argument 1)
Reply
#4

Use strlen for strings.

Код:
format(cNameclans, 20, "%s", strlen(inputtext));
Reply
#5

C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11835) : error 035: argument type mismatch (argument 1)
C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11836) : error 028: invalid subscript (not an array or too many subscripts): "cNameclans"
C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11836) : warning 215: expression has no effect
C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11836) : error 001: expected token: ";", but found "]"
C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11836) : error 029: invalid expression, assumed zero
C:\Users\User\Documents\ValoareCuK\gamemodes\rworl d.pwn(11836) : fatal error 107: too many error messages on one line


11835
if(strlen(inputtext) > 20 || strlen(inputtext) < 3) return SCM(playerid, -1, "{008BC7}Informatie: {ffffff}Numele clanului nu poate fi mai scurt de 3 caractere sau mai lung de 20.");
format(cNameclans, 20, "%s", strlen(inputtext));

11836
new verificaClan = MySQLCheckClan( cNameclans[playerid] );
Reply
#6

BUMP
Reply
#7

someone??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)