/darlider
#6

Quote:
Originally Posted by brunim
Посмотреть сообщение
Obrigado, persebi que se codigo ficou bem mais limpo e facil de entender, mas agora ele me apresenta 2 erros na compilaзгo:
pawn Код:
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(3282) : warning 204: symbol is assigned a value that is never used: "pPos"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(8865) : error 047: array sizes do not match, or destination array is too small
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(8868) : error 047: array sizes do not match, or destination array is too small
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(15590) : warning 225: unreachable code
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1221) : warning 204: symbol is assigned a value that is never used: "BolsaDeValoresPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1981) : warning 204: symbol is assigned a value that is never used: "ComputadorPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1252) : warning 204: symbol is assigned a value that is never used: "EnterHospitalPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1254) : warning 204: symbol is assigned a value that is never used: "ExitHospitalPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1230) : warning 204: symbol is assigned a value that is never used: "FaculdadePick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1233) : warning 204: symbol is assigned a value that is never used: "GaragemJailPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1233 -- 18552) : warning 203: symbol is never used: "GetPointDistanceToPointExMorph"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1255) : warning 204: symbol is assigned a value that is never used: "HospitalPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1236) : warning 204: symbol is assigned a value that is never used: "LimparPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1258) : warning 204: symbol is assigned a value that is never used: "MacumbaPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1161) : warning 204: symbol is assigned a value that is never used: "MainTimer"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1242) : warning 204: symbol is assigned a value that is never used: "PizzaPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1260) : warning 204: symbol is assigned a value that is never used: "RezaPick"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1989) : warning 204: symbol is assigned a value that is never used: "on501vehicle"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1990) : warning 204: symbol is assigned a value that is never used: "on702vehicle"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1990 -- 18552) : warning 203: symbol is never used: "pCPActive"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1990 -- 18552) : warning 203: symbol is never used: "pCPID"
D:\PCS-SAMP\Servidor\gamemodes\psa.pwn(1990 -- 18552) : warning 203: symbol is never used: "soundID"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
As essas sao as linhas: 8865 A primeira e 8868 A ultima:
pawn Код:
var = strtok(cmdtext,idx);
        if(!strlen(var)) return SendClientMessage(playerid,ErrorColor,"[PSBR]: /darlider [IDPlayer] [LiderID (0(Desempregado)~16)]");
        id = ReturnUser(var);
        var = strtok(cmdtext,idx);

Estranho , a parte do cуdigo que o compilador estб acusando de error compila normal aqui, alйm de vбrios membros do fуrum que usam strtok nгo terem esse tipo de problema .



Bem, como o error й relativo б variбvel array var ser muito pequena, apenas aumentei o tamanho da mesma :



pawn Код:
if(strcmp(cmd,"/darlider",true)==0)
    {
        new var[256], id, Liderid;
        var = strtok(cmdtext,idx);
        if(!strlen(var)) return SendClientMessage(playerid,ErrorColor,"[PSBR]: /darlider [IDPlayer] [LiderID (0(Desempregado)~16)]");
        id = ReturnUser(var);
        var = strtok(cmdtext,idx);
        if(!strlen(var)) return SendClientMessage(playerid,ErrorColor,"[PSBR]: /darlider [IDPlayer] [LiderID (0(Desempregado)~16)]");
        Liderid = strval(var);

        if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid,ErrorColor,"[PSBR]: Vocк nгo й Administrador.");
        if(Liderid > 16 || Liderid < 0) return SendClientMessage(playerid,ErrorColor,"[PSBR]: /darlider [IDPlayer] [LiderID (0(Desempregado)~16)]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,ErrorColor,"[PSBR]: Jogador Disconectado.");
       
        new FilePathInfo[256];
       
        switch(Liderid)
        {
            case Mendigo:
            {
                format(FilePathInfo,sizeof(FilePathInfo),"%sOrg%d.ini",OrgFiles,PlayerInfo[id][Org]);
                dini_Set(FilePathInfo,"Lider","Ninguйm");
                LoadOrgInfo(PlayerInfo[id][Org]);
            }
            default:
            {
                format(FilePathInfo,sizeof(FilePathInfo),"%sOrg%d.ini",OrgFiles,Liderid);
                dini_Set(FilePathInfo,"Lider",PlayerInfo[id][Name]);
                LoadOrgInfo(Liderid);
            }
        }

        PlayerInfo[id][Org] = Liderid;
        PlayerInfo[id][Lider] = Liderid;
        PlayerInfo[id][Cargo] = 6;
        RemovePlayerFromVehicle(playerid);

        if(Liderid == Mendigo) SetPlayerSkin(id,94),PlayerInfo[playerid][Cargo] = 0;
        else if(Liderid == PM) SetPlayerSkin(id,PMSkin[0]);
        else if(Liderid == PF) SetPlayerSkin(id,PFSkin[0]);
        else if(Liderid == GOE) SetPlayerSkin(id,GOESkin[0]);
        else if(Liderid == Exercito) SetPlayerSkin(id,ExercitoSkin[0]);
        else if(Liderid == FAB) SetPlayerSkin(id,FABSkin[0]);
        else if(Liderid == FARC) SetPlayerSkin(id,FARCSkin[0]);
        else if(Liderid == AlQaeda) SetPlayerSkin(id,AlQaedaSkin[0]);
        else if(Liderid == Governo) SetPlayerSkin(id,GovernoSkin[0]);
        else if(Liderid == Assassino) SetPlayerSkin(id,AssassinoSkin[0]);
        else if(Liderid == Reporter) SetPlayerSkin(id,ReporterSkin[0]);
        else if(Liderid == Yakuza) SetPlayerSkin(id,YakuzaSkin[0]);
        else if(Liderid == Mafia) SetPlayerSkin(id,MafiaSkin[0]);
        else if(Liderid == GavioesDaFiel) SetPlayerSkin(id,GavioesSkin[0]);
        else if(Liderid == ManchaVerde) SetPlayerSkin(id,MVSkin[0]);
        else if(Liderid == TorcidaJovemDoGremio) SetPlayerSkin(id,TJGSkin[0]);
        else if(Liderid == RacaRubroNegra) SetPlayerSkin(id,RRNSkin[0]);
       
        PlayerInfo[id][Skin] = GetPlayerSkin(id);

        new Float:x,Float:y,Float:z;
        GetPlayerPos(id,x,y,z);
        SetPlayerPos(id,x,y,z);
        format(var, sizeof(var), "[PSBR]: Vocк foi setado como lнder da organizaзгo de ID %i.",Liderid);
        SendClientMessage(id,BroadCastColor, var);
        SendClientMessage(id,BroadCastColor,"[PSBR]: Vocк setou este player como lнder de uma Org.");
        return true;
    }

Qualquer problema, recomendo que use KcmD, que й como strtok, sу que mais fбcil e nгo exige mudanзas em todos os comandos :

https://sampforum.blast.hk/showthread.php?tid=195380




Espero ter ajudado .
Reply


Messages In This Thread
/darlider - by brunim - 22.07.2011, 15:46
Re: /darlider - by Josma_cmd - 22.07.2011, 15:48
Re: /darlider - by brunim - 22.07.2011, 15:50
Re: /darlider - by rjjj - 22.07.2011, 16:07
Re: /darlider - by brunim - 22.07.2011, 16:31
Re: /darlider - by rjjj - 22.07.2011, 16:51
Re: /darlider - by brunim - 22.07.2011, 17:12
Re: /darlider - by wallon - 22.07.2011, 17:46
Re: /darlider - by brunim - 22.07.2011, 18:00
Re: /darlider - by wallon - 22.07.2011, 18:26

Forum Jump:


Users browsing this thread: 1 Guest(s)