if(strcmp(tmp, "trancar", true) == 0) { if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP."); return 1; } if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid) { SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP."); return 1; } new keycar; if(vehid == PlayerInfo[playerid][pCarKey]) { keycar = PlayerInfo[playerid][pVeiculo]; } else if(vehid == PlayerInfo[playerid][pCarKey2]) { keycar = PlayerInfo[playerid][pVeiculo2]; } if(IsPlayerConnected(playerid)) { if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0); } format(string, sizeof(string), "~w~Veiculo VIP~n~~g~Aberto"); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, string, 10000, 3); CarInfo[keycar][cLock] = 0; return 1; } else { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1); } format(string, sizeof(string), "~w~Veiculo VIP~n~~r~Trancado"); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, string, 10000, 3); CarInfo[keycar][cLock] = 1; return 1; } } return true; }
if(strcmp(cmdtext, "/trancar", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"* Vocк precisa estar dentro do veiculo!");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1,"* Apenas o motorista pode trancar.");
new carro = GetPlayerVehicleID(playerid);
for(new i; i < MAX_PLAYERS; ++i) if(i != playerid)
{
SetVehicleParamsForPlayer(carro, i, 0, 1), GameTextForPlayer(playerid,"trancado",3000,6);
}
return SendClientMessage(playerid, -1, "Carro trancado!");
}
if(strcmp(cmdtext, "/destrancar", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xd6deacAA,"{FA053A}[ERRO]:{F9FAF5} Vocк precisa estar dentro do veiculo para destranca-lo.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,GetPlayerColor(playerid),"{FA053A}[ERRO]:{F9FAF5} Apenas o motorista pode destrancar o veiculo!");
new carro = GetPlayerVehicleID(playerid);
for(new i; i < MAX_PLAYERS; ++i) if(i != playerid)
{
SetVehicleParamsForPlayer(vehicleid,i, 0, 0), GameTextForPlayer(playerid,"Carro destrancado!",3000,6);
}
return SendClientMessage(playerid, -1, "* Carro destrancado!");
}
if(strcmp(tmp, "trancar", true) == 0)
{
if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid) return SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
new keycar;
if(vehid == PlayerInfo[playerid][pCarKey]) keycar = PlayerInfo[playerid][pVeiculo];
else if(vehid == PlayerInfo[playerid][pCarKey2]) keycar = PlayerInfo[playerid][pVeiculo2];
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
new Pecas[7];
GetVehicleParamsEx(CarInfo[keycar][ownedvehicle], Pecas[0], Pecas[1], Pecas[2], Pecas[3], Pecas[4], Pecas[5], Pecas[6]);
if(CarInfo[keycar][cLock] == 1)
{
SetVehicleParamsEx(CarInfo[keycar][ownedvehicle], Pecas[0], Pecas[1], Pecas[2], false, Pecas[4], Pecas[5], Pecas[6]);
GameTextForPlayer(playerid, "~w~Veiculo VIP~n~~g~Aberto", 10000, 3);
CarInfo[keycar][cLock] = 0;
}
else
{
SetVehicleParamsEx(CarInfo[keycar][ownedvehicle], Pecas[0], Pecas[1], Pecas[2], true, Pecas[4], Pecas[5], Pecas[6]);
GameTextForPlayer(playerid, "~w~Veiculo VIP~n~~r~Trancado", 10000, 3);
CarInfo[keycar][cLock] = 1;
}
return true;
}
Troque seu cуdigo por este :
pawn Код:
Espero ter ajudado . |
Infelizmente nгo consegui ainda assim, esta com o mesmo problema com este cуdigo
Alguem tem outra funзгo ? |
if(strcmp(tmp, "vender", true) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, playername, sizeof(playername)); if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP."); return true; } if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != 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 true; } else if(PlayerInfo[playerid][pCarKey2] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pVeiculo2]][cOwner], true) == 0) { new car = PlayerInfo[playerid][pVeiculo2]; 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][pCarKey2] = 0; PlayerInfo[playerid][pVeiculo2] = 0; SaveCars(); return true; } } return true; }