format(string,sizeof(string),"Este veнculo й de %s",CarInfo[i][cOwner]);
GivePlayerMoney(playerid, -2000);
|
tipo assim queria q quando a pessoa entrasse nele perderia 2k
|
if(vehicleid != CarInfo[playerid][cOwner])
{
for(new other; other < MAX_PLAYERS; other ++)
{
format(string,sizeof(string),"Este veнculo й de %s", CarInfo[other][cOwner]);
GivePlayerMoney(other, 2000);
}
SendClientMessage(playerid, -1, string);
GivePlayerMoney(playerid, -2000);
}
|
Se nгo compreendeu o que o ipsLuan comentou:
Код:
if(vehicleid != CarInfo[playerid][cOwner])
{
for(new other; other < MAX_PLAYERS; other ++)
{
format(string,sizeof(string),"Este veнculo й de %s", CarInfo[other][cOwner]);
GivePlayerMoney(other, 2000);
}
SendClientMessage(playerid, -1, string);
GivePlayerMoney(playerid, -2000);
}
|
/veiculo retirargrana
new GuardarDinheiro[MAX_PLAYERS];
if(vehicleid != CarInfo[playerid][cOwner])
{
for(new other; other < MAX_PLAYERS; other ++)
{
format(string,sizeof(string),"Este veнculo й de %s", CarInfo[other][cOwner]);
GuardarDinheiro[other] += 2000;
}
SendClientMessage(playerid, -1, string);
GivePlayerMoney(playerid, -2000);
}
if(vehicleid == CarInfo[playerid][cOwner])
{
if(GuardarDinheiro[playerid] > 0)
GivePlayerMoney(playerid, GuardarDinheiro[playerid]),
GuardarDinheiro[playerid] = 0;
}
if(CarInfo[vehicleid][cOwner] != playerid)
{
new name[MAX_PLAYER_NAME],string[144];
GetPlayerName(CarInfo[vehicleid][cOwner],name,sizeof(name));
format(string,sizeof(string),"Este veнculo й de %s",name);
SendClientMessage(playerid,-1,string);
GivePlayerMoney(CarInfo[vehicleid][cOwner],2000);
GivePlayerMoney(playerid,-2000);
}
if(strcmp(cmd, "/retirargrana", true) == 0)
{
if(PlayerInfo[playerid][pCarKey] != 0 || PlayerInfo[playerid][pCarKey2] != 0)
{
for(new i = 1; i < sizeof(CarInfo); i++)
{
new keycar;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { keycar = PlayerInfo[playerid][pVeiculo]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey2]) { keycar = PlayerInfo[playerid][pVeiculo2]; }
format(gstring, 128, "Vocк retirou R$%d do seu carro vip!", CarInfo[keycar][cGrana]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
GivePlayerMoney(playerid, CarInfo[keycar][cGrana]);
CarInfo[keycar][cGrana] = 0;
return true;
}
}
return true;
}