31.12.2010, 13:36
Boas pessoal, eu queria saber se alguйm me podia ajudar em duas coisas.
Eu tenho o comando /entrar e /sair, e eu queria que voces me ajudassem a fazer uma KEY, para dar para fazer o /entrar e o /sair no SPACE.
Eu tenho o comando /entrar e /sair, e eu queria que voces me ajudassem a fazer uma KEY, para dar para fazer o /entrar e o /sair no SPACE.
Код:
if(strcmp(cmd, "/entrar", true) == 0) { for(new i = 0; i < sizeof(Houses); i++) { if(IsPlayerInRangeOfPoint(playerid,1.0,Houses[i][EnterX],Houses[i][EnterY],Houses[i][EnterZ])) { if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld]) { if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1) { SetPlayerInterior(playerid,Houses[i][ExitInterior]); SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]); SetPlayerVirtualWorld(playerid,i); SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]); } else { GameTextForPlayer(playerid, "~r~Trancado", 5000, 1); } } } } for(new i = 0; i < sizeof(Building); i++) { if(IsPlayerInRangeOfPoint(playerid,1.0,Building[i][EnterX],Building[i][EnterY],Building[i][EnterZ])) { if(GetPlayerVirtualWorld(playerid) == Building[i][EnterWorld]) { if(Building[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1) { SetPlayerInterior(playerid,Building[i][ExitInterior]); SetPlayerVirtualWorld(playerid,i); SetPlayerPos(playerid,Building[i][ExitX],Building[i][ExitY],Building[i][ExitZ]); SetPlayerFacingAngle(playerid,Building[i][ExitAngle]); GivePlayerCash(playerid,-Building[i][EntranceFee]); } else { GameTextForPlayer(playerid, "~r~Trancado", 5000, 1); } } } } for(new i = 0; i < sizeof(Businesses); i++) { if(IsPlayerInRangeOfPoint(playerid,1.0,Businesses[i][EnterX],Businesses[i][EnterY],Businesses[i][EnterZ])) { if(GetPlayerVirtualWorld(playerid) == Businesses[i][EnterWorld]) { if(PlayerInfo[playerid][pBizKey] == i || GetPlayerCash(playerid) >= Businesses[i][EntranceCost]) { if(PlayerInfo[playerid][pBizKey] != i) { if(Businesses[i][Locked] == 1 && PlayerInfo[playerid][pAdmin] == 0) { GameTextForPlayer(playerid, "~r~Negуcio Trancado", 5000, 1); return 1; } if(Businesses[i][Products] == 0) { GameTextForPlayer(playerid, "~r~Sem Produtos", 5000, 1); return 1; } GivePlayerCash(playerid,-Businesses[i][EntranceCost]); format(string, sizeof(string), "[Info:] You have been charged $%d to enter %s", Businesses[i][EntranceCost],Businesses[i][BusinessName]); SendClientMessage(playerid,COLOR_WHITE,string); Businesses[i][Till] += Businesses[i][EntranceCost]; Businesses[i][Products]--; SetPlayerInterior(playerid,Businesses[i][ExitInterior]); SetPlayerPos(playerid,Businesses[i][ExitX],Businesses[i][ExitY],Businesses[i][ExitZ]); SetPlayerVirtualWorld(playerid,i); SetPlayerFacingAngle(playerid,Businesses[i][ExitAngle]); SaveBusinesses(); } else { SendClientMessage(playerid, COLOR_WHITE, "[Info:] Free entrance for the boss"); SetPlayerInterior(playerid,Businesses[i][ExitInterior]); SetPlayerPos(playerid,Businesses[i][ExitX],Businesses[i][ExitY],Businesses[i][ExitZ]); SetPlayerVirtualWorld(playerid,i); SetPlayerFacingAngle(playerid,Businesses[i][ExitAngle]); } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have enough money"); } } } } return 1; }
Код:
if(strcmp(cmd, "/sair", true) == 0) { if(IsPlayerConnected(playerid)) { new carid = GetPlayerVehicleID(playerid); if(IsAnOwnableCar(carid) && DynamicCars[carid][cOwned] == 0) { RemoveDriverFromVehicle(playerid); } for(new i = 0; i < sizeof(Houses); i++) { if(IsPlayerInRangeOfPoint(playerid,3.0,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ])) { if(GetPlayerVirtualWorld(playerid) == i) { if(Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1) { SetPlayerInterior(playerid,Houses[i][EnterInterior]); SetPlayerPos(playerid,Houses[i][EnterX],Houses[i][EnterY],Houses[i][EnterZ]); SetPlayerVirtualWorld(playerid,Houses[i][EnterWorld]); SetPlayerFacingAngle(playerid,Houses[i][EnterAngle]); } else { GameTextForPlayer(playerid, "~r~Door Locked", 5000, 1); } } } } for(new i = 0; i < sizeof(Building); i++) { if(IsPlayerInRangeOfPoint(playerid,3.0,Building[i][ExitX],Building[i][ExitY],Building[i][ExitZ])) { if(GetPlayerVirtualWorld(playerid) == i) { if(Building[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1) { SetPlayerInterior(playerid,Building[i][EnterInterior]); SetPlayerVirtualWorld(playerid,Building[i][EnterWorld]); SetPlayerPos(playerid,Building[i][EnterX],Building[i][EnterY],Building[i][EnterZ]); SetPlayerFacingAngle(playerid,Building[i][EnterAngle]); } else { GameTextForPlayer(playerid, "~r~Door Locked", 5000, 1); } } } } for(new i = 0; i < sizeof(Businesses); i++) { if(IsPlayerInRangeOfPoint(playerid,3.0,Businesses[i][ExitX],Businesses[i][ExitY],Businesses[i][ExitZ])) { if(GetPlayerVirtualWorld(playerid) == i) { if(Businesses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1) { SetPlayerInterior(playerid,Businesses[i][EnterInterior]); SetPlayerVirtualWorld(playerid,Businesses[i][EnterWorld]); SetPlayerPos(playerid,Businesses[i][EnterX],Businesses[i][EnterY],Businesses[i][EnterZ]); SetPlayerFacingAngle(playerid,Businesses[i][EnterAngle]); } else { GameTextForPlayer(playerid, "~r~Door Locked", 5000, 1); } } } } } return 1; }