Quote:
Originally Posted by comanfiss
Gente to com uns pequenos Player esperto q usa o comando /irparacasa quando ta trabalhando se alguem poder me ajuda eu queria q esse comando /irparacasa nao pegase quando ta em trabalho ....alguem sabe?agradeзo ajuda
pawn Код:
// This command teleports you to your selected house COMMAND:irparacasa(playerid, params[]) { // Setup local variables new HouseList[1000];
// Send the command to all admins so they can see it SendAdminText(playerid, "/irparacasa", params);
// Check if the player has logged in if (APlayerData[playerid][LoggedIn] == true) { // Check if the player has a wanted level of less than 3 if (GetPlayerWantedLevel(playerid) < 3) { // Check if the player is not jailed if (APlayerData[playerid][PlayerJailed] == 0) { // Check if the player is not inside a vehicle if (GetPlayerVehicleID(playerid) == 0) { // Ask to which house the player wants to add his vehicle for (new i; i < MAX_HOUSESPERPLAYER; i++) { // Check if this houseindex is occupied if (APlayerData[playerid][Houses][i] != 0) format(HouseList, 1000, "%s{00FF00}%s{FFFFFF}\n", HouseList, AHouseData[APlayerData[playerid][Houses][i]][HouseName]); else format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Slot Vazio"); } ShowPlayerDialog(playerid, DialogGoHome, DIALOG_STYLE_LIST, "Choose the house to go to:", HouseList, "Selecionar", "Cancelar"); } else SendClientMessage(playerid, 0xFF0000FF, "Voce Precisa estar a pe para ir a Sua Casa"); } else SendClientMessage(playerid, 0xFF0000FF, "Voce nao pode usar /irparacasa Preso"); } else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Voce nao pode usar /irparacasa quando esta sendo Procurado"); } else return 0;
// Let the server know that this was a valid command return 1; }
|
Optmizando e adicionando o bloqueio.
pawn Код:
COMMAND:irparacasa(playerid, params[])
{
new HouseList[1000];
SendAdminText(playerid, "/irparacasa", params);
if (APlayerData[playerid][LoggedIn] == false) return 0;
if (GetPlayerWantedLevel(playerid) >= 3) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Voce nao pode usar /irparacasa quando esta sendo Procurado");
if (APlayerData[playerid][PlayerJailed] != 0) return SendClientMessage(playerid, 0xFF0000FF, "Voce nao pode usar /irparacasa Preso");
if (GetPlayerVehicleID(playerid) != 0) return SendClientMessage(playerid, 0xFF0000FF, "Voce Precisa estar a pe para ir a Sua Casa");
if(APlayerData[playerid][JobStarted] == true) return SendClientMessage(playerid, 0xFF0000FF, "Vocк deve usar sem estar em um trabalho!");
for (new i; i < MAX_HOUSESPERPLAYER; i++) {
if (APlayerData[playerid][Houses][i] != 0)
format(HouseList, 1000, "%s{00FF00}%s{FFFFFF}\n", HouseList, AHouseData[APlayerData[playerid][Houses][i]][HouseName]);
else
format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Slot Vazio");
}
ShowPlayerDialog(playerid, DialogGoHome, DIALOG_STYLE_LIST, "Choose the house to go to:", HouseList, "Selecionar", "Cancelar");
return 1;
}
^^