[ajuda] /batercartao
#1

Bom galera queria que quando o cop ficasse de folga ele ficaria com skin de civil e com nome branco isso ja conseguir fazer, o que eu quero fazer agora й que ele quando batercartao volta se com a skin da org.

pawn Код:
if(strcmp(cmd, "/batercartao", true) == 0)
    {
        if(PlayerInfo[playerid][pJailed] != 0)
        {
            SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
            return 1;
        }
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsACop(playerid))
            {
                if (PlayerToPoint(2, playerid,255.3,77.4,1003.6) || PlayerToPoint(2,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(2,playerid,230.1107,165.2237,1003.0234) || PlayerToPoint(2, playerid,240.7396,112.9709,1003.2188) || PlayerToPoint(2, playerid,1530.5187,-1702.5320,6.2252) || PlayerToPoint(2, playerid,302.7606,-1529.7537,24.9219) || PlayerToPoint(2, playerid,-1345.8823,492.5301,11.2027)
                || PlayerToPoint(2, playerid,326.4911,307.0710,999.1484) || PlayerInfo[playerid][pLocal] != 255)
                {
                    if(OnDuty[playerid]==0)
                    {
                        format(string, sizeof(string), "Oficial %s bateu o cartгo e estб em serviзo, digite /servico policia.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerArmour(playerid, 100);
                        SetPlayerHealth(playerid, 100);
                        OnDuty[playerid] = 1;
                        EmpregoDuty[playerid] = 2;
                        Copsronda += 1;
                    }
                    else if(OnDuty[playerid]==1)
                    {
                        format(string, sizeof(string), "Oficial %s estб de folga e nгo vai mais receber seus chamados.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerSkin(playerid, 23);
                        SetPlayerColor(playerid, 0xFFFFFFAA);
                        OnDuty[playerid] = 0;
                        EmpregoDuty[playerid] = 0;
                        Copsronda -= 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo estб em um vestiбrio !");
                    return 1;
                }
            }
            else if(PlayerInfo[playerid][pMembro] == 4||PlayerInfo[playerid][pLider] == 4)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Medics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo com o seu trabalho e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    format(string, sizeof(string), "[Anuncio] O Medico %s estб em servico, /servico medico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Medics += 1;
                }
            }
            else if(PlayerInfo[playerid][pEmprego] == 5)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Mechanics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo como mecвnico e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    format(string, sizeof(string), "[Anuncio] O Mecanico %s estб em servico, /servico mecanico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Mechanics += 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo й Um Oficial/Mйdico/Mecвnico !");
            }
        }
        return 1;
    }
Reply
#2

Use GetPlayerSkin e SetPlayerSkin.
Reply
#3

mais se eu fizer isso vo ter que fazer de um por um. quando os caras aceita o convite eles ficam com a skin da org, ou seja eu queria que continua se com a skin quando o cop bater se o cartao
Reply
#4

Entгo, use:

pawn Код:
if(strcmp(cmd, "/batercartao", true) == 0)
    {
        if(PlayerInfo[playerid][pJailed] != 0)
        {
            SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
            return 1;
        }
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new skinanterior;
            skinanterior = GetPlayerSkin(playerid);
            if(IsACop(playerid))
            {
                if (PlayerToPoint(2, playerid,255.3,77.4,1003.6) || PlayerToPoint(2,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(2,playerid,230.1107,165.2237,1003.0234) || PlayerToPoint(2, playerid,240.7396,112.9709,1003.2188) || PlayerToPoint(2, playerid,1530.5187,-1702.5320,6.2252) || PlayerToPoint(2, playerid,302.7606,-1529.7537,24.9219) || PlayerToPoint(2, playerid,-1345.8823,492.5301,11.2027)
                || PlayerToPoint(2, playerid,326.4911,307.0710,999.1484) || PlayerInfo[playerid][pLocal] != 255)
                {
                    if(OnDuty[playerid]==0)
                    {
                        format(string, sizeof(string), "Oficial %s bateu o cartгo e estб em serviзo, digite /servico policia.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerArmour(playerid, 100);
                        SetPlayerHealth(playerid, 100);
                        OnDuty[playerid] = 1;
                        SetPlayerSkin(playerid, skinanterior);
                        EmpregoDuty[playerid] = 2;
                        Copsronda += 1;
                    }
                    else if(OnDuty[playerid]==1)
                    {
                        format(string, sizeof(string), "Oficial %s estб de folga e nгo vai mais receber seus chamados.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerSkin(playerid, 23);
                        SetPlayerColor(playerid, 0xFFFFFFAA);
                        OnDuty[playerid] = 0;
                        EmpregoDuty[playerid] = 0;
                        Copsronda -= 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo estб em um vestiбrio !");
                    return 1;
                }
            }
            else if(PlayerInfo[playerid][pMembro] == 4||PlayerInfo[playerid][pLider] == 4)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Medics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo com o seu trabalho e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    SetPlayerSkin(playerid, skinanterior);
                    format(string, sizeof(string), "[Anuncio] O Medico %s estб em servico, /servico medico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Medics += 1;
                }
            }
            else if(PlayerInfo[playerid][pEmprego] == 5)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Mechanics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo como mecвnico e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    SetPlayerSkin(playerid, skinanterior);
                    format(string, sizeof(string), "[Anuncio] O Mecanico %s estб em servico, /servico mecanico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Mechanics += 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo й Um Oficial/Mйdico/Mecвnico !");
            }
        }
        return 1;
    }
Reply
#5

Modifiquei o cуdigo para que funcione como vocк pediu .


Isto deve resolver o seu problema :


pawn Код:
if(strcmp(cmd, "/batercartao", true) == 0)
    {
        if(PlayerInfo[playerid][pJailed] != 0)
        {
            SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
            return 1;
        }
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsACop(playerid))
            {
                if (PlayerToPoint(2, playerid,255.3,77.4,1003.6) || PlayerToPoint(2,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(2,playerid,230.1107,165.2237,1003.0234) || PlayerToPoint(2, playerid,240.7396,112.9709,1003.2188) || PlayerToPoint(2, playerid,1530.5187,-1702.5320,6.2252) || PlayerToPoint(2, playerid,302.7606,-1529.7537,24.9219) || PlayerToPoint(2, playerid,-1345.8823,492.5301,11.2027)
                || PlayerToPoint(2, playerid,326.4911,307.0710,999.1484) || PlayerInfo[playerid][pLocal] != 255)
                {
                    if(OnDuty[playerid]==0)
                    {
                        if(GetPVarInt(playerid,"SkinCop")) SetPlayerSkin(playerid, GetPVarInt(playerid,"SkinCop"));
                        format(string, sizeof(string), "Oficial %s bateu o cartгo e estб em serviзo, digite /servico policia.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerArmour(playerid, 100);
                        SetPlayerHealth(playerid, 100);
                        OnDuty[playerid] = 1;
                        EmpregoDuty[playerid] = 2;
                        Copsronda += 1;
                    }
                    else if(OnDuty[playerid]==1)
                    {
                        SetPVarInt(playerid, "SkinCop", GetPlayerSkin(playerid));
                        format(string, sizeof(string), "Oficial %s estб de folga e nгo vai mais receber seus chamados.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerSkin(playerid, 23);
                        SetPlayerColor(playerid, 0xFFFFFFAA);
                        OnDuty[playerid] = 0;
                        EmpregoDuty[playerid] = 0;
                        Copsronda -= 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo estб em um vestiбrio !");
                    return 1;
                }
            }
            else if(PlayerInfo[playerid][pMembro] == 4||PlayerInfo[playerid][pLider] == 4)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Medics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo com o seu trabalho e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    format(string, sizeof(string), "[Anuncio] O Medico %s estб em servico, /servico medico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Medics += 1;
                }
            }
            else if(PlayerInfo[playerid][pEmprego] == 5)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Mechanics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo como mecвnico e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    format(string, sizeof(string), "[Anuncio] O Mecanico %s estб em servico, /servico mecanico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Mechanics += 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo й Um Oficial/Mйdico/Mecвnico !");
            }
        }
        return 1;
    }


Espero ter ajudado .
Reply
#6

Quote:
Originally Posted by rjjj
Посмотреть сообщение
Modifiquei o cуdigo para que funcione como vocк pediu .


Isto deve resolver o seu problema :


pawn Код:
if(strcmp(cmd, "/batercartao", true) == 0)
    {
        if(PlayerInfo[playerid][pJailed] != 0)
        {
            SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
            return 1;
        }
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsACop(playerid))
            {
                if (PlayerToPoint(2, playerid,255.3,77.4,1003.6) || PlayerToPoint(2,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(2,playerid,230.1107,165.2237,1003.0234) || PlayerToPoint(2, playerid,240.7396,112.9709,1003.2188) || PlayerToPoint(2, playerid,1530.5187,-1702.5320,6.2252) || PlayerToPoint(2, playerid,302.7606,-1529.7537,24.9219) || PlayerToPoint(2, playerid,-1345.8823,492.5301,11.2027)
                || PlayerToPoint(2, playerid,326.4911,307.0710,999.1484) || PlayerInfo[playerid][pLocal] != 255)
                {
                    if(OnDuty[playerid]==0)
                    {
                        if(GetPVarInt(playerid,"SkinCop")) SetPlayerSkin(playerid, GetPVarInt(playerid,"SkinCop"));
                        format(string, sizeof(string), "Oficial %s bateu o cartгo e estб em serviзo, digite /servico policia.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerArmour(playerid, 100);
                        SetPlayerHealth(playerid, 100);
                        OnDuty[playerid] = 1;
                        EmpregoDuty[playerid] = 2;
                        Copsronda += 1;
                    }
                    else if(OnDuty[playerid]==1)
                    {
                        SetPVarInt(playerid, "SkinCop", GetPlayerSkin(playerid));
                        format(string, sizeof(string), "Oficial %s estб de folga e nгo vai mais receber seus chamados.", sendername);
                        OOCNews(COLOR_DBLUE,string);
                        SetPlayerSkin(playerid, 23);
                        SetPlayerColor(playerid, 0xFFFFFFAA);
                        OnDuty[playerid] = 0;
                        EmpregoDuty[playerid] = 0;
                        Copsronda -= 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo estб em um vestiбrio !");
                    return 1;
                }
            }
            else if(PlayerInfo[playerid][pMembro] == 4||PlayerInfo[playerid][pLider] == 4)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Medics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo com o seu trabalho e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    format(string, sizeof(string), "[Anuncio] O Medico %s estб em servico, /servico medico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Medics += 1;
                }
            }
            else if(PlayerInfo[playerid][pEmprego] == 5)
            {
                if(EmpregoDuty[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora Vocк Estб De Folga, e nгo receberб chamados!");
                    EmpregoDuty[playerid] = 0;
                    Mechanics -= 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Agora vocк estб de plantгo como mecвnico e irб receber chamadas de pessoas que precisam.");
                    EmpregoDuty[playerid] = 1;
                    format(string, sizeof(string), "[Anuncio] O Mecanico %s estб em servico, /servico mecanico.", sendername);
                    OOCNews(0x2993EDAA,string);
                    Mechanics += 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo й Um Oficial/Mйdico/Mecвnico !");
            }
        }
        return 1;
    }


Espero ter ajudado .
Oo, os mortos ressucitaram, os escavadores foram encontrados, e os mineiros foram resgatados.
Reply
#7

nгo deu certo. pq assim que ele ficar de folga ele recebe a skin de civil, ou seja apartir daquele momento a skin anterior vai ser de civil, nao a skin da farda quando ele nasce.
Reply
#8

vo testar a do RJJ
Reply
#9

RJJ deu certo brigadao. mesmo!
Reply
#10

revivendo topico fui testar aqui e, deu tudo certo em relaзгo a skin mais a cor do nome fica branco quando o oficial volta
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)