03.08.2013, 04:26
Tenta alguma coisa assim
pawn Код:
if(strcmp(tmp, "vender1", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey] != vehid)
{
SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pVeiculo]][cOwner], true) == 0)
{
new car = PlayerInfo[playerid][pVeiculo];
CarInfo[car][cOwned] = 0;
CarInfo[car][cModel] = 560;
CarInfo[car][cColorOne] = 0;
CarInfo[car][cColorTwo] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[car][cOwner], "Dealership", 0, strlen("Dealership"), 999);
GivePlayerMoney(playerid,CarInfo[car][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Carro Vip Vendido Por: ~n~~g~$%d", CarInfo[car][cValue]);
GameTextForPlayer(playerid, string, 10000, 3);
RemovePlayerFromVehicleEx(playerid);
Controle(playerid, 1);
PlayerInfo[playerid][pCarKey] = 0;
PlayerInfo[playerid][pVeiculo] = 0;
SaveCars();
return 1;
}
}
return 1;
}
if(strcmp(tmp, "vender2", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCarKey2] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey2] != vehid)
{
SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey2] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pVeiculo2]][cOwner], true) == 0)
{
new car2 = PlayerInfo[playerid][pVeiculo2];
CarInfo[car2][cOwned] = 0;
CarInfo[car2][cModel] = 560;
CarInfo[car2][cColorOne] = 0;
CarInfo[car2][cColorTwo] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[car2][cOwner], "Dealership", 0, strlen("Dealership"), 999);
GivePlayerMoney(playerid,CarInfo[car2][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Carro Vip Vendido Por: ~n~~g~$%d", CarInfo[car2][cValue]);
GameTextForPlayer(playerid, string, 10000, 3);
RemovePlayerFromVehicleEx(playerid);
Controle(playerid, 1);
PlayerInfo[playerid][pCarKey2] = 0;
PlayerInfo[playerid][pVeiculo2] = 0;
SaveCars();
return 1;
}
}
return 1;
}
if(strcmp(tmp, "vender3", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCarKey3] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey3] != vehid)
{
SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey3] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pVeiculo3]][cOwner], true) == 0)
{
new car3 = PlayerInfo[playerid][pVeiculo3];
CarInfo[car3][cOwned] = 0;
CarInfo[car3][cModel] = 560;
CarInfo[car3][cColorOne] = 0;
CarInfo[car3][cColorTwo] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[car3][cOwner], "Dealership", 0, strlen("Dealership"), 999);
GivePlayerMoney(playerid,CarInfo[car3][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Carro Vip Vendido Por: ~n~~g~$%d", CarInfo[car3][cValue]);
GameTextForPlayer(playerid, string, 10000, 3);
RemovePlayerFromVehicleEx(playerid);
Controle(playerid, 1);
PlayerInfo[playerid][pCarKey3] = 0;
PlayerInfo[playerid][pVeiculo3] = 0;
SaveCars();
return true;
}
}
return true;
}