[Ajuda]Comando /pintar
#1

Queria que este comando pintasse o carro na mesma hora, mais ele muda a cor do carro somente dps do server reiniciar. Se poderem me ajudar agradeзo desde jб.

PHP код:
    if (strcmp(cmd"/pintarcarro"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
House PlayerInfo[playerid][pPHousekey];
            
GetPlayerName(playeridplayernamesizeof(playername));
            if (
House != 255 && strcmp(playernameHouseInfo[PlayerInfo[playerid][pPHousekey]][hOwner], true) == 0)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD3,"(R$5000) USE: /pintarcarro [COR 1 ou 2] [COR ID]");
                    return 
1;
                }
                new 
COLORnum strval(tmp);
                if(
COLORnum || COLORnum 1)
                {
                    
SendClientMessage(playeridCOLOR_GRAD3,"Cor 1(Principal) ou 2(Secundбria)");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD3,"(R$5000) USE: /pintarcarro [COR 1 ou 2] [COR ID]");
                }
                new 
COLOR strval(tmp);
                if(
COLOR 126)
                {
                    
SendClientMessage(playeridCOLOR_GRAD3,"Mбximo й 126");
                    return 
1;
                }
                if (
GetPlayerMoney(playerid) < 5000)
                {
                    
SendClientMessage(playeridCOLOR_GRAD3,"Vocк nгo tem (R$5000)");
                }
                if(
COLORnum == 1)
                {
                    
HouseInfo[House][hVcol1] = COLOR;
                    
format(stringsizeof(string), "Cor 1 Trocada Para %d -R$5000",COLOR);
                    
SendClientMessage(playeridCOLOR_GRAD3,string);
                }
                else
                {
                    
HouseInfo[House][hVcol2] = COLOR;
                    
format(stringsizeof(string), "Cor 2 Trocada Para %d -R$5000",COLOR);
                    
SendClientMessage(playeridCOLOR_GRAD3,string);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD2"   Vocк nгo tem uma casa");
                return 
1;
            }
        }
        return 
1;
    } 
Reply
#2

pawn Код:
if (strcmp(cmd, "/pintarcarro", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new carid = GetPlayerVehicleID(playerid);
            new House = PlayerInfo[playerid][pPHousekey];
            GetPlayerName(playerid, playername, sizeof(playername));
            if (House != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPHousekey]][hOwner], true) == 0)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD3,"(R$5000) USE: /pintarcarro [COR 1 ou 2] [COR ID]");
                    return 1;
                }
                new COLORnum = strval(tmp);
                if(COLORnum > 2 || COLORnum < 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD3,"Cor 1(Principal) ou 2(Secundбria)");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD3,"(R$5000) USE: /pintarcarro [COR 1 ou 2] [COR ID]");
                }
                new COLOR = strval(tmp);
                if(COLOR > 126)
                {
                    SendClientMessage(playerid, COLOR_GRAD3,"Mбximo й 126");
                    return 1;
                }
                if (GetPlayerMoney(playerid) < 5000)
                {
                    SendClientMessage(playerid, COLOR_GRAD3,"Vocк nгo tem (R$5000)");
                }
                if(COLORnum == 1)
                {
                    ChangeVehicleColor(carid, COLOR, HouseInfo[House][hVcol2]);
                    HouseInfo[House][hVcol1] = COLOR;
                    format(string, sizeof(string), "Cor 1 Trocada Para %d -R$5000",COLOR);
                    SendClientMessage(playerid, COLOR_GRAD3,string);
                }
                else
                {
                    ChangeVehicleColor(carid, HouseInfo[House][hVcol1], COLOR);
                    HouseInfo[House][hVcol2] = COLOR;
                    format(string, sizeof(string), "Cor 2 Trocada Para %d -R$5000",COLOR);
                    SendClientMessage(playerid, COLOR_GRAD3,string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem uma casa");
                return 1;
            }
        }
        return 1;
    }
Use [ pawn] [ /pawn] da prуxima vez
Reply
#3

eu uso esse, sу para mecanico, admin e admin RCON


if(strcmp(cmd, "/pintar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Mecanico || dini_Int(file, "aAdmin") == 1 || IsPlayerAdmin(playerid) == 1){
new tmp[256];
new cor1,cor2;
new veiculo;
tmp = strtok(cmdtext,idx);
cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/pintar [cor1] [cor2]");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)