if (strcmp("/v ligar", cmdtext, true, 10) == 0 || strcmp("/v l", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(motor[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob); motor[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s girou a chave e ligou o veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v desligar", cmdtext, true, 10) == 0 || strcmp("/v d", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(motor[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob); motor[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s girou a chave e desligou o veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v farolon", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(luz[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob); luz[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s liga o farol do veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v faroloff", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(luz[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob); luz[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s desliga o farol do veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } /*if (strcmp("/v alarmeon", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(alarme[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob); alarme[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {2F991A}Ligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s ativou o alarme do veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v alarmeoff", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(alarme[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu,VEHICLE_PARAMS_OFF, por, cap, porma, ob); alarme[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {E31919}Desligado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s desativou o alarme do veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v destrancar", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(portas[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, alar, VEHICLE_PARAMS_ON, cap, porma, ob); portas[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Portas {2F991A}Abertas!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s destrancou as portas do veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v trancar", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(portas[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, alar, VEHICLE_PARAMS_OFF, cap, porma, ob); portas[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Portas {E31919}Fechadas!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s trancou as portas do veiculo.", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } }*/ if (strcmp("/v capoabrir", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(capo[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_ON, porma, ob); capo[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Capo {2F991A}Aberto!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s abriu o capo do veiculo", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v capofechar", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(capo[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_OFF, porma, ob); capo[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Capo {E31919}Fechado!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s fechou o capo do veiculo", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v portamalasabrir", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(portamalas[playerid] == 0) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob); portamalas[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFAA, "Portamalas {2F991A}Aberto!"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s abriu o portamalas do veiculo", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if (strcmp("/v portamalasfechar", cmdtext, true, 10) == 0) { new pname[MAX_PLAYER_NAME]; new string[70]; new mot, lu, alar, por, cap, porma, ob; new carro = GetPlayerVehicleID(playerid); if(carro != INVALID_VEHICLE_ID) { if(portamalas[playerid] == 1) { GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob); SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob); portamalas[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFAA, "Portamalas {E31919}Fechado!"); SendClientMessage(playerid, COLOR_DBLUE, "fechou o portamalas do veiculo"); GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s fechou o portamalas do veiculo", pname); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } }
if(newstate == 2) { for(new i = 0; i < sizeof(CarInfo); i++) { new newcar = GetPlayerVehicleID(playerid); new Aluguelbox[256]; new string[256]; if(newcar == CarInfo[i][ownedvehicle]) { if(CarInfo[i][cOwned]==0) { TogglePlayerControllable(playerid, 0); CarOffered[playerid]=1; //format(string,sizeof(string),"~w~Carro: %s~n~Preco: ~g~%d~n~~w~/veiculo comprar para comprar",CarInfo[i][cDescription],CarInfo[i][cValue]); format(Aluguelbox, sizeof(Aluguelbox),"Carro: %s Preco: %d\nGostaria de compra-lo ?", CarInfo[i][cDescription],CarInfo[i][cValue]); TogglePlayerControllable(playerid, 0); ShowPlayerDialog(playerid, 2624, DIALOG_STYLE_MSGBOX, "Deseja compra-lo?", Aluguelbox, "Sim", "Nгo"); } if(CarInfo[i][cOwned]==1) { new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); if(strcmp(playername,CarInfo[i][cOwner],true)==0) { format(string,sizeof(string),"Olб %s Bem vindo ao seu Veiculo.", playerid, CarInfo[i][cGrana]); SendClientMessage(playerid, 0xCCCCFFFF, string); TogglePlayerControllable(playerid, 1); } else { format(string,sizeof(string),"Veiculo de %s",CarInfo[i][cOwner]); SendClientMessage(playerid, 0xCCCCFFFF, string); RemovePlayerFromVehicle(playerid); } } } } }
Vocк que que apareзa uma mensagem se ele nгo estiver em um veiculo?
|
if (strcmp("/v ligar", cmdtext, true, 10) == 0 || strcmp("/v l", cmdtext, true, 10) == 0)
{
new pname[MAX_PLAYER_NAME];
new string[70];
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
motor[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s girou a chave e ligou o veiculo.", pname);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}else{
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo estб em um veiculo");
}
}
}
nгo sei se isso ta certo mais... testa
pawn Код:
|