[Ajuda] Porque Nгo Esta Pegando ?
#1

Oi , Boa Noite Primeira Mente , Neah !!!

- Estou com um probleminha aqui em meu GM .

- Eu sou admin level (1342) e o meu comando de /darsocio nгo esta pegando fala que eu nao tenho autorizaзгo para usar seria erro isso ?


pawn Код:
/*if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }*/
- Alguem poderia me ajudar porfavor ?



- Obrigado Desde Jб
Reply
#2

bom voce tem que estar logado na rcon '-' voce esta se estiver me avise ai eu vejo para vocee
Reply
#3

Faзa esse debug e veja o que printa no console do servidor!

Troque seu cуdigo por esse:
pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            printf("Level de Administrador: %d", PlayerInfo[playerid][pAdmin]);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
Reply
#4

tenta trocar o:
if (PlayerInfo[playerid][pAdmin] >= 1339)
por:
if (PlayerInfo[playerid][pAdmin] >= 1342)
Reply
#5

pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            printf("Level de Administrador: %d", PlayerInfo[playerid][pAdmin]);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
- Fiz (Isso)
- Aconteceu (Isso)

pawn Код:
C:\Documents and Settings\Kluunk\Desktop\Serve\gamemodes\BHL.pwn(28041) : error: 017: undefined symbol "pVip"
C:\Documents and Settings\Kluunk\Desktop\Serve\gamemodes\BHL.pwn(28041) : warning: 215: expression has no effect

- Linhas



pawn Код:
PlayerInfo[para1][pVip] = level;
Reply
#6

Quote:
Originally Posted by Alisson Silva Alves
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            printf("Level de Administrador: %d", PlayerInfo[playerid][pAdmin]);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
- Fiz (Isso)
- Aconteceu (Isso)

pawn Код:
C:\Documents and Settings\Kluunk\Desktop\Serve\gamemodes\BHL.pwn(28041) : error: 017: undefined symbol "pVip"
C:\Documents and Settings\Kluunk\Desktop\Serve\gamemodes\BHL.pwn(28041) : warning: 215: expression has no effect

- Linhas



pawn Код:
PlayerInfo[para1][pVip] = level;
Poxa, vocк tem o comando mas nгo tem a variavel de setar o vip? ...

Esse comando dessa forma no GM se vc digitar ele mostra a mensagem que voce nao tem autorizaзгo?

Se sim, procure pelo mesmo comando em outra parte no GM, creio que possa estar duplicado!

Se nгo, procure no topo do GM por "pVip"
Reply
#7

pawn Код:
enum pInfo{pKey[128],pLevel,pAdmin,pHelper,[COLOR="Magenta"](pVIP)[/COLOR],pSocio,pGrampo,gPupgrade,pConnectTime,pReg,pSex,pAge,pMuted,
pSequestrado,pExp,pCash,pConta,pCrimes,pKills,pDeaths,pPhoneBook,pLottoNr,pFishes,pBiggestFish,pEmprego,
pSalario,pHeadValue,pHeadValueT,pJailed,pJailTime,pMats,pDrogas,pDrogas2,pDrogas3,pLider,pMembro,pCargo,
pSkin,pContractTime,pDetSkill,pSexSkill,pBoxSkill,pLawSkill,pMechSkill,pNewsSkill,pDrogasSkill,pCookSkill,
pFishSkill,Float:pSHealth,pInt,pCapacete,pLocal,pTeam,pPnumber,pPHousekey,pPbiskey,Float:pPos_x,Float:pPos_y,
Float:pPos_z,pCarLic,pFlyLic,pBoatLic,pFishLic,pGunLic,pPayDay,pCDPlayer,pWins,pLoses,pAlcoholPerk,pDrugPerk,
pMiserPerk,pPainPerk,pTraderPerk,pTut,pWarns,pMarried,pParedao,pRequestingBackup,pMask,pMaskuse,pBarraca,
pMarriedTo[64],pSpawn,pSafeDrogas,pSafeDrogas2,pSafeDrogas3,pVeiculo,pVeiculo2,pVeiculo3,pCarKey,pCarKey2,
psMats,pPHouseCarkey,pLuta,pDorgado,pDorgado2,pDoenca,pCreditos,pLastLogin[20],pGun1,pGun2,pGun3,pGun4,pGun5,
pGun6,pGun7,pGun8,pGun9,pGun10,pGun11,pGun12,pAmmo1,pAmmo2,pAmmo3,pAmmo4,pAmmo5,pAmmo6, pAmmo7,pAmmo8,pAmmo9,
pAmmo10,pAmmo11,pAmmo12,pCheckInfoOrg,pCaixinha,pBan,};

Tem ele Ali No Comeзo
Reply
#8

Quote:
Originally Posted by Alisson Silva Alves
Посмотреть сообщение
pawn Код:
enum pInfo{pKey[128],pLevel,pAdmin,pHelper,[COLOR="Magenta"](pVIP)[/COLOR],pSocio,pGrampo,gPupgrade,pConnectTime,pReg,pSex,pAge,pMuted,
pSequestrado,pExp,pCash,pConta,pCrimes,pKills,pDeaths,pPhoneBook,pLottoNr,pFishes,pBiggestFish,pEmprego,
pSalario,pHeadValue,pHeadValueT,pJailed,pJailTime,pMats,pDrogas,pDrogas2,pDrogas3,pLider,pMembro,pCargo,
pSkin,pContractTime,pDetSkill,pSexSkill,pBoxSkill,pLawSkill,pMechSkill,pNewsSkill,pDrogasSkill,pCookSkill,
pFishSkill,Float:pSHealth,pInt,pCapacete,pLocal,pTeam,pPnumber,pPHousekey,pPbiskey,Float:pPos_x,Float:pPos_y,
Float:pPos_z,pCarLic,pFlyLic,pBoatLic,pFishLic,pGunLic,pPayDay,pCDPlayer,pWins,pLoses,pAlcoholPerk,pDrugPerk,
pMiserPerk,pPainPerk,pTraderPerk,pTut,pWarns,pMarried,pParedao,pRequestingBackup,pMask,pMaskuse,pBarraca,
pMarriedTo[64],pSpawn,pSafeDrogas,pSafeDrogas2,pSafeDrogas3,pVeiculo,pVeiculo2,pVeiculo3,pCarKey,pCarKey2,
psMats,pPHouseCarkey,pLuta,pDorgado,pDorgado2,pDoenca,pCreditos,pLastLogin[20],pGun1,pGun2,pGun3,pGun4,pGun5,
pGun6,pGun7,pGun8,pGun9,pGun10,pGun11,pGun12,pAmmo1,pAmmo2,pAmmo3,pAmmo4,pAmmo5,pAmmo6, pAmmo7,pAmmo8,pAmmo9,
pAmmo10,pAmmo11,pAmmo12,pCheckInfoOrg,pCaixinha,pBan,};

Tem ele Ali No Comeзo
NUUS nunca vi um cуdigo assim o.O carai -.-

Entгo, troque o "pVIP" por "pVip"

Se tiver em outras partes do Gm "pVIP", troque por "pVip"
Reply
#9

Tenho 2 CMD /Darsocio

pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "Vocк ganhou Sуcio do admin %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /retirarsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }


pawn Код:
//----------------------------------[MAKEADMIN]------------------------------------------------
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            printf("Level de Administrador: %d", PlayerInfo[playerid][pAdmin]);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
{
Reply
#10

Quote:
Originally Posted by Alisson Silva Alves
Посмотреть сообщение
Tenho 2 CMD /Darsocio

pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "Vocк ganhou Sуcio do admin %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /retirarsocio [id]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, 256);
            if (strcmp(sendername,"Alien_CarboN",true)==0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return true;
    }


pawn Код:
//----------------------------------[MAKEADMIN]------------------------------------------------
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [ ID ] [LEVEL ( 1 ~ 3000 )]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            printf("Level de Administrador: %d", PlayerInfo[playerid][pAdmin]);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pVip] = level;
                        printf("ADMIN CMD: %s promoveu %s para level %d de socio.", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Vocк foi promovido para level %d de socio - Por %s", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d de Socio.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1339)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 0;
                        format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
{
Estб explicado --'

ta ae:
pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
          return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");

        new para1;
        para1 = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        GetPlayerName(playerid, sendername, 256);
        if (PlayerInfo[playerid][pAdmin] >= 1339)
        {
            if(para1 != INVALID_PLAYER_ID)
            {
                GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                PlayerInfo[para1][pSocio] = 1;
                format(string, sizeof(string), "Vocк ganhou Sуcio do admin %s", sendername);
                SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
        else SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
        return true;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, COLOR_GRAD2, "USE: /retirarsocio [id]");

        new para1;
        para1 = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        GetPlayerName(playerid, sendername, 256);
        if(PlayerInfo[playerid][pAdmin] >= 1339)
        {
            if(para1 != INVALID_PLAYER_ID)
            {
                GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                PlayerInfo[para1][pSocio] = 0;
                format(string, sizeof(string), "Seu Socio Foi retirado pelo adm %s", sendername);
                SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "Vocк retirou o Socio de %s.", giveplayer);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
        else SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
        return true;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)