17.01.2012, 17:04
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;
}
