17.11.2011, 19:04
Olб pessoal, gostaria de pidir a vocкs um sistema de /pintar [Cor ID] [Cor 2 ID]
obrigado
obrigado
if(!strcmp("/pintar",cmdtext))
{
new tmp[24], idx; tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, -1, "/pintar [cor 1] [cor 2]");
new color1 = strval(tmp);
if(color1 < 0 || color1 > 300)
return SendClientMessage(playerid, -1, "Cores de 0/300.");
new color2;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
color2 = color1;
else
color2 = strval(tmp);
if(color2 < 0 || color2 > 300)
return SendClientMessage(playerid, -1, "Cores de 0/300.");
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
}
CarColor[playerid][0] = color1;
pawn Code:
new
cmd[64],
idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/pintar", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new
string[128],
tmp[64];
tmp = strtok(cmdtext, idx);
new
tmp2 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid),tmp2,tmp2);
format(string, sizeof(string),"Cor do teu carro foi mudada para: %i",tmp2);
SendClientMessage(playerid, 0xF60000AA, string);
}
else return SendClientMessage(playerid, 0xF60000AA, "Erro: Ce nao ta em nenhum veнculo negao!");
return 1;
}
CMD:pintar(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Antes vocк precisa de um veiculo.");
new Corez[2];
if(sscanf(params, "ii", Corez[0], Corez[1])) return SendClientMessage(playerid, -1, " [Erro] Use /pintar [Cor1][Cor2]");
if(Corez[0] < 0 || Corez[0] > 126) return SendClientMessage(playerid, -1, "Cores de 0 a 126!");
if(Corez[1] < 0 || Corez[1] > 126) return SendClientMessage(playerid, -1, "Cores de 0 a 126!");
ChangeVehicleColor(GetPlayerVehicleID(playerid), Corez[0], Corez[1]);
SendClientMessage(playerid, -1, "Cores do carros modificadas!");
return true;
}
Offtopic: profissional e com 2 "S" amigo... |
if(strcmp(cmd, "/pintar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
new tmp[256];
new cor1,cor2;
new veiculo;
tmp = strtok(cmdtext,idx);
cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, 0x33AA33A, "/pintar [cor1] [cor2]");
return 1;
}
cor2 = strval(tmp);
veiculo = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid,veiculo)){
ChangeVehicleColor(veiculo,cor1,cor2);
format(string, sizeof(string), "(~) Cores Alteradas para [%d] e [%d].", aname, playerid, cor1, cor2);
SendClientMessage(playerid, 0xFF2F2FAA, string);
return 1;
}
}
}