[Ajuda] Pintar [ID] [ID]
#2

Strcmp
pawn Код:
if (!strcmp(cmd, "/pintarcarro") ) {

    if ( !IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, -1, "Vocк nгo esta em nenhum veнculo!");
       
    tmp = strtok(cmdtext, idx);
   
    if ( !strlen(tmp) )
        return SendClientMessage(playerid, -1, "Use /pintarcarro [cor 1] [cor 2]");

    new cor1 = strval(tmp);
   
    tmp = strtok(cmdtext, idx);

    if ( !strlen(tmp) )
        return SendClientMessage(playerid, -1, "Use /pintarcarro [cor 1] [cor 2]");
       
    new cor2 = strval(tmp);
   
    if ( cor1 > 241 || cor1 < 0 || cor2 > 241 || cor2 < 0)
        return SendClientMessage(playerid, -1, "Cor invбlida! Use valores entre 0 e 241!");
       
   
    ChangeVehicleColor(GetPlayerVehicleID(playerid), cor1 , cor2 );
    format (tmp, sizeof tmp, "Cores do veнculo alteradas! Cor 1 agora й %d e cor 2 й %d", cor1, cor2);
    SendClientMessage(playerid, -1, tmp);
   
    return 1;
}
ZCMD
pawn Код:
CMD:pintarcarro(playerid, params[]) {

    if ( !IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, -1, "Vocк nгo esta em nenhum veнculo!");

    new cor1, cor2;

    if ( sscanf(params, "dd", cor1, cor2) )
        return SendClientMessage(playerid, -1, "Use /pintarcarro [cor 1] [cor 2]");

    if ( cor1 > 241 || cor1 < 0 || cor2 > 241 || cor2 < 0)
        return SendClientMessage(playerid, -1, "Cor invбlida! Use valores entre 0 e 241!");

    new info[60];
    ChangeVehicleColor(GetPlayerVehicleID(playerid), cor1 , cor2 );
    format (info, sizeof info, "Cores do veнculo alteradas! Cor 1 agora й %d e cor 2 й %d", cor1, cor2);
    SendClientMessage(playerid, -1, info);

    return 1;
}
Reply


Messages In This Thread
Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 21:08
Re: Pintar [ID] [ID] - by Gii - 08.01.2014, 21:26
Re: Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 22:13
Re: Pintar [ID] [ID] - by GodsAndMonsters - 08.01.2014, 22:15
Re: Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 22:19
Re: Pintar [ID] [ID] - by Gii - 08.01.2014, 22:28
Re: Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 22:36
Re: Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 22:51
Re: Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 22:57
Re: Pintar [ID] [ID] - by jonathan_agv - 08.01.2014, 23:02

Forum Jump:


Users browsing this thread: 1 Guest(s)