Jump to content

MarianDeparateanu

Membru
  • Posts

    4
  • Joined

  • Last visited

Posts posted by MarianDeparateanu

  1. Problema intalnita (descriere):Salut am facut un system de factiuni dynamic(ceva gen VX-RP) si cand dau /setleader nu mi se salveaza datele in baza de date.Tin sa mentionez ca lucrez pe Gamemode-ul lui Wopss
    Ero(area / rile) / warning-(ul / urile):-
    Liniile de cod / sursa / script-ul(obligatoriu): 

    CMD:setleader(playerid, params[]) {
        if(PlayerInfo[playerid][pAdmin] >= 6) {
            new	groupID;
    
    		if(sscanf(params, "ud", playerid, groupID)) {
    			return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setleader [playerid] [groupid]");
    		}
            else {
    			if(groupID < 1 || groupID > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");
    			else if(PlayerInfo[playerid][pMember] != 0) return SCM(playerid, COLOR_GREY, "This player is in a group. Use /auninvite first!");
    			PlayerInfo[playerid][pMember] = groupID;
    			PlayerInfo[playerid][pMemberRank] = 7;
    
    			new
    
    			    string[128];
    
    			GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
    
    			format(string, sizeof(string), "You have set %s to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
    			SendClientMessage(playerid, COLOR_WHITE, string);
    			PlayerInfo[playerid][pSkin] = groupVariables[PlayerInfo[playerid][pMember]][gLeaderSkin];
    			SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    			Update(playerid, pMemberx);
    			Update(playerid, pMemberRankx);
    
    			GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
    
    			format(string, sizeof(string), "<< Administrator %s has set you to lead group %s >>", szPlayerName, groupVariables[groupID][gGroupName]);
    			SendClientMessage(playerid, COLOR_PURPLE, string);
    			SetPlayerToTeamColor(playerid);
    			mysql_format(handle, string, sizeof(string), "UPDATE players SET playerDays = '0' WHERE playerID = '%d'", PlayerInfo[playerid][pInternalID]);
    			mysql_query(handle, string);
    
    			if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pMember] == 15)
    			{
    				JustJoined[playerid] = 1;
    			}
    
    			new quer[2560];
    			new strings1[255];
    			format(strings1,255, "%s is now the leader of faction %s.", PlayerInfo[playerid][pNormalName], groupVariables[groupID][gGroupName]);
    			new year, month, day, hour, minute, second;
    			new time[25];
    			gettime(hour, minute, second);
    			getdate(year, month, day);
    			format(time, 25, "%02d.%02d.%d %02d:%02d:%02d", day, month, year, hour, minute, second);
    			format(quer, sizeof(quer), "INSERT INTO `faction_logs` (playerID, Text, playerSkin, time) VALUES('%d', '%s', '%d', '%s')", PlayerInfo[playerid][pInternalID], strings1, PlayerInfo[playerid][pSkin], time);
    			mysql_query(handle, quer);
    		}
        }
    
        return 1;
    }
    


    Imagini / Video (optional):
    Ati incercat sa rezolvati singur?: Da am incercat sa fac ceva la comanda....dar tot degeaba

    format(string, sizeof(string), "You have set %s to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
    			SendClientMessage(playerid, COLOR_WHITE, string);
    			PlayerInfo[playerid][pSkin] = groupVariables[PlayerInfo[playerid][pMember]][gLeaderSkin];
    			SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
                mysql_format(handle, string, sizeof(string), "UPDATE players SET playerGroup = '%s' WHERE username = '%d'", PlayerInfo[playerid][pMember], szPlayerName);
    			mysql_query(handle, string);
    			mysql_format(handle, string, sizeof(string), "UPDATE players SET playerGroupRank = '7' WHERE username = '%d'", PlayerInfo[playerid][pMemberRank], szPlayerName);
    			mysql_query(handle, string);
    			Update(playerid, pMemberx);
    			Update(playerid, pMemberRankx);

     

    group.PNG

  2. Problema intalnita (descriere):am inceput sa lucrez pe Gamemode-ul lui Wopss(w3op) si am bagat sistemul de salvare al factiunilor din VX-RP si cand pornesc GM imi apare in consola o eroare
    Ero(area / rile) / warning-(ul / urile): -
    Liniile de cod / sursa / script-ul(obligatoriu): 

    13:01:18]  [MYSQL]: Connection to database (w3op) was established!
    [13:01:18]  [debug] Run time error 4: "Array index out of bounds"
    [13:01:18]  [debug]  Accessing element at index 10 past array upper bound 9
    [13:01:18]  [debug] AMX backtrace:
    [13:01:18]  [debug] #0 0001333c in public IniGroups () from gamemode.amx
    [13:01:18]  [debug] #1 0000842c in public PZone_OnGameModeInit () from gamemode.amx
    [13:01:18]  [debug] #2 native CallLocalFunction () from samp-server.exe
    [13:01:18]  [debug] #3 000073f4 in public Itter_OnGameModeInit () from gamemode.amx
    [13:01:18]  [debug] #4 native CallLocalFunction () from samp-server.exe
    [13:01:18]  [debug] #5 0000293c in public ScriptInit_OnGameModeInit () from gamemode.amx
    [13:01:18]  [debug] #6 00001924 in public zcmd_OnGameModeInit () from gamemode.amx
    [13:01:18]  [debug] #7 native CallLocalFunction () from samp-server.exe
    [13:01:18]  [debug] #8 00001418 in public OnGameModeInit () from gamemode.amx


    Imagini / Video (optional):http://imgur.com/21RzyGe
    Ati incercat sa rezolvati singur?:-

    Din moment ce nu stiu de la ce este nu pot pune nimic mai sus

    save.PNG

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.