PHP код:
public OnPlayerText(playerid, text[])
{
new string[250];
if(GetPlayerVirtualWorld(playerid) == 0 )
{
new id = GetClosetHouseID(playerid),Houses = GetOwnedHouses(playerid);
if(strval(text) == 1 && House[id][Owned] == 0 && IsPlayerInDynamicCP(playerid, House[id][CPEnter]))
{
if(GetPlayerMoney(playerid) >= House[id][Price])
{
if(Houses >= 2)
{
SCM(playerid,COLOR_RED,"You Can Not Have More Houses");
return 0;
}
format(House[id][Owner], 32, "%s", PlayerName(playerid));
House[id][OnSell] = 0;
House[id][Owned] = 1;
GivePlayerMoney(playerid, -(House[id][Price]));
format(House[id][HouseName], 22, "Home");
format(string,sizeof(string),"%s",House[id][HouseName]);
UpdateDynamic3DTextLabelText(House[id][DLabel],OWNED_HOUSE,string);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
CheckHouse(id);
format(string, sizeof(string), "~g~House Info~n~~n~~w~You have ~g~purchased~w~ this property for ~y~$%d. For more informations use ~y~/housemenu.~n~~n~",(House[id][Price]));
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
SetPlayerInterior(playerid,House[id][IntID]);
SetPlayerPos(playerid,House[id][SpawnIntX],House[id][SpawnIntY],House[id][SpawnIntZ]);
SetPlayerFacingAngle(playerid,(House[id][SpawnIntA]));
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,House[id][VW]);
SetPlayerInterior(playerid,House[id][IntID]);
}
else
{
SCM(playerid,COLOR_RED,"You Dont Have Enough Money");
}
return 0;
}
if(strval(text) == 2 && IsPlayerInDynamicCP(playerid, House[id][CPEnter]))
{
if(House[id][Locked] == 0)
{
TogglePlayerDynamicCP(playerid, House[id][CPExit], 0);
SetPlayerInterior(playerid,House[id][IntID]);
SetPlayerPos(playerid,House[id][SpawnIntX],House[id][SpawnIntY],House[id][SpawnIntZ]);
SetPlayerFacingAngle(playerid,(House[id][SpawnIntA]));
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,House[id][VW]);
SetPlayerInterior(playerid,House[id][IntID]);
SetTimerEx("Visitor",1000*15,false,"i",playerid);
SCM(playerid,INFO,"You are currently visiting this house. You have 15 seconds before you are automatically ejected out.");
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
}
return 0;
}
if(strval(text) == 3 && IsPlayerInDynamicCP(playerid, House[id][CPEnter]))
{
if(House[id][Owned] != 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Open ~y~ChatBox ~w~ With ~y~T ~w~or ~y~ F6~n~~w~And Enter Correct House Password To Enter House");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
InfoText[playerid][EnterUsingPw] = 1;
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
}
return 0;
}
if(strval(text) == 4 && IsPlayerInDynamicCP(playerid, House[id][CPEnter]))
{
if(GetPlayerWantedLevel(playerid) <= 3)
{
new RobChance = random(100);
if(RobChance < 10)
{
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
SetPlayerWantedLevel(playerid, 6);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,House[id][IntID]);
SetPlayerPos(playerid,House[id][SpawnIntX],House[id][SpawnIntY],House[id][SpawnIntZ]);
SetPlayerFacingAngle(playerid,(House[id][SpawnIntA]));
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,House[id][VW]);
SetPlayerInterior(playerid,House[id][IntID]);
HideMenu(playerid);
format(string, sizeof(string), "~n~~g~House Robbery Information:~n~~n~~w~You have successfully broken into this house. You can start house robbery with with ~y~/robhouse. ~w~Also you gained ~p~+1 rob skill experience. ~w~Check your skills with /morestats.~n~~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
}
else
{
HideMenu(playerid);
format(string, sizeof(string), "~n~~g~House Robbery Information:~n~~n~~w~You have ~r~failed~w~ in house robbery. Wanted level is increased, but you gained ~p~+1 rob skill experience. ~w~Check your skills in your /stats.~n~~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
SetPlayerWantedLevel(playerid, 4);
}
}
else
{
HideMenu(playerid);
format(string, sizeof(string), "~n~~r~House Robbery~n~~n~~w~Your wanted level is too high!~n~You can ~r~not ~w~ attempt robbery.~n~~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+3);
}
return 0;
}
}
if(GetPlayerVirtualWorld(playerid) != 0)
{
new ID = GetClosetHouseIntID(playerid);
if(strval(text) == 11 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(House[ID][Owner], 32, "For Sale!");
House[ID][OnSell] = 1;
House[ID][Owned] = 0;
House[ID][Locked] = 0;
House[ID][Password] = 0000;
House[ID][HouseCarID] = 0;
House[ID][HCarX] = 0;
House[ID][HCarY] = 0;
House[ID][HCarZ] = 0;
House[ID][HCarA] = 0;
House[ID][GunSlot2] = 0;
House[ID][GunSlot1] = 0;
House[ID][AmmoSlot1] = 0;
House[ID][AmmoSlot2] = 0;
GivePlayerMoney(playerid,(House[ID][Price]*HOUSE_SELL_CASH));
GivePlayerMoney(playerid,House[ID][Storage]);
House[ID][Storage] = 0;
format(House[ID][HouseName], 22, "For Sale");
format(string,sizeof(string),"%s",House[ID][HouseName]);
UpdateDynamic3DTextLabelText(House[ID][DLabel],UNOWNED_HOUSE,string);
CheckHouse(ID);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,House[ID][SpawnX],House[ID][SpawnY],House[ID][SpawnZ]);
SetPlayerVirtualWorld(playerid,0);
format(string, sizeof(string), "~b~House Info~n~~n~~n~~w~The Property ~r~Sold ~w~For ~y~%d $",(House[ID][Price]*HOUSE_SELL_CASH));
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 6 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
if(House[ID][Locked] == 0)
{
HideMenu(playerid);
House[ID][Locked] = 1;
CheckHouse(ID);
format(string, sizeof(string), "~g~House informations~n~~n~~n~~w~House is: ~r~locked ~w~for visitors now.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
else if(House[ID][Locked] == 1)
{
HideMenu(playerid);
House[ID][Locked] = 0;
CheckHouse(ID);
format(string, sizeof(string), "~g~House informations~n~~n~~n~~w~House is: ~g~unlocked ~w~for visitors now.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
return 0;
}
if(strval(text) == 2 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
if(House[ID][Locked] == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~n~~g~House Info~n~~n~~n~~w~House name: ~p~%s~n~~w~House storage: ~g~$%d~n~~w~House password: ~g~%s~n~~w~Status: ~g~unlocked~n~~w~House adress: ~w~%s~n~~n~",(House[ID][HouseName]),(House[ID][Storage]),(House[ID][Password]),(House[ID][HouseLocation]));
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
}
if(House[ID][Locked] == 1)
{
HideMenu(playerid);
format(string, sizeof(string), "~n~~g~House Informations~n~~n~~n~~w~House name: ~p~%s~n~~w~House storage: ~g~$%d~n~~w~House password: ~g~%s~n~~w~Status: ~r~locked~n~~w~House adress: ~w~%s~n~~n~",(House[ID][HouseName]),(House[ID][Storage]),(House[ID][Password]),(House[ID][HouseLocation]));
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
}
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 1 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu:~n~~n~~w~Open ~y~chatbox ~w~with ~y~T ~w~or~y~ F6~w~and enter new house name. Note: House name can contain up to ~y~16 ~w~characters and can be seen about 50 meters from house door.~n~~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
InfoText[playerid][ChangeName] = 1;
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 3 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Enter Command: ~y~/HDeposit ~w~(Amount Of Money)~n~~n~~y~Note: ~w~Normal houses can store up to $%d, but semi mansions and castles up to $%d~n~",MAX_HOUSE_STORAGE,MAX_CASTLE_STORAGE);
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 7 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Enter Command: ~y~/PutGun ~w~[Slot 1-2] [Ammo]~n~~n~~r~Note:~n~~n~~w~You can use two weapon slot storages for two kind of weapons. Ammo storage is unlimited.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 8 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Enter Command: ~y~/TakeGun ~w~[Slot 1-2]~n~~n~~r~Note:~n~~n~~w~You can take guns from two storages. All ammo that you have in chosen slot will be moved to your hands.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 9 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Use command: ~y~/putweed ~w~to store your weed in a house.You can only store up to 5 kilograms in normal houses and 10 kilograms to mansions. Law enforcers can acces to every house and they can seize your weed if they find it.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 10 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Use command: ~y~/getweed ~w~to get weed from your house storage.Law enforcers can acces to every house and they can seize your weed if they find it.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 4 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~ ~w~Enter Command: ~y~/HWithdraw ~w~(Amount Of Money)~n~You dont want to carry huge amount of money in your hands becouse you can easly get robbed by someone.~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
if(strval(text) == 5 && strcmp(House[ID][Owner],PlayerName(playerid), true ) == 0)
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Menu~n~~n~~w~Open ~y~chatbox ~w~with ~y~T ~w~or~y~ F6~w~ and enter new house password. Maximum password lenght is 4 characters.~n~~n~~r~Note: ~w~Be careful to what people you are telling your house password becouse they can abuse it!~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
InfoText[playerid][HousePassword] = 1;
PlayerPlaySound(playerid, 1138, 0.0, 0.0, 2.0);
return 0;
}
}
if(InfoText[playerid][ChangeName] == 1)
{
new id = GetClosetHouseIntID(playerid);
if(strlen(text) > 16)
{
SCM(playerid,COLOR_RED,"Invalid name lenght. Please enter name up to 16 characters.");
return 0;
}
format(House[id][HouseName], 22, "%s", text);
SCM(playerid,INFO,"House Name Successfully Changed");
format(string,sizeof(string),"%s",House[id][HouseName]);
UpdateDynamic3DTextLabelText(House[id][DLabel],OWNED_HOUSE,string);
CheckHouse(id);
InfoText[playerid][ChangeName] = 0;
return 0;
}
if(InfoText[playerid][HousePassword] == 1)
{
new id = GetClosetHouseIntID(playerid);
if(strlen(text) > 4)
{
SCM(playerid,COLOR_RED,"Invalid password lenght. Please enter password up to 4 characters.");
return 0;
}
format(House[id][Password], 5, "%s", text);
CheckHouse(id);
InfoText[playerid][HousePassword] = 0;
format(string,sizeof(string),"House Password Changed to: %s",text);
SCM(playerid,INFO,string);
return 0;
}
if(InfoText[playerid][EnterUsingPw] == 1)
{
new id = GetClosetHouseID(playerid);
if(strcmp(House[id][Password],text) == 0)
{
SetPlayerInterior(playerid,House[id][IntID]);
SetPlayerPos(playerid,House[id][SpawnIntX],House[id][SpawnIntY],House[id][SpawnIntZ]);
SetPlayerFacingAngle(playerid,(House[id][SpawnIntA]));
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,House[id][VW]);
SetPlayerInterior(playerid,House[id][IntID]);
InfoText[playerid][EnterUsingPw] = 0;
}
else
{
HideMenu(playerid);
format(string, sizeof(string), "~g~House Security Password~n~~n~~r~Incorrect Password~n~~n~~w~Press ~y~LMB ~w~To Close This Box~n~");
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
InfoText[playerid][EnterUsingPw] = 0;
}
return 0;
}
if(IsMuted{playerid} == 1)
{
SendClientMessage(playerid, COLOR_MAGENTA, "Your muted, you cant speak right now!");
return 0; }
if(OnCommandList[playerid] == 1)
{
if(strval(text) == 1)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR1);
return 0;
}
if(strval(text) == 2)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR2);
return 0;
}
if(strval(text) == 3)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR3);
return 0;
}
if(strval(text) == 4)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR4);
return 0;
}
if(strval(text) == 5)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR5);
return 0;
}
if(strval(text) == 6)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR6);
return 0;
}
if(strval(text) == 7)
{
OnCommandList[playerid]=1;
TextDrawHideForPlayer(playerid, FAQText);
TextDrawShowForPlayer(playerid, FAQTextR7);
return 0;
}
}
if(OnCommandList[playerid] == 2)
{
if(strval(text) == 1)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR1);
return 0;
}
if(strval(text) == 2)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR2);
return 0;
}
if(strval(text) == 3)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR3);
return 0;
}
if(strval(text) == 4)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR4);
return 0;
}
if(strval(text) == 5)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR5);
return 0;
}
if(strval(text) == 6)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR6);
return 0;
}
if(strval(text) == 7)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid, CMDST);
TextDrawShowForPlayer(playerid, CMDSTR7);
return 0;
}
if(strval(text) == 8)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid,CMDST);
TextDrawShowForPlayer(playerid, CMDSTR8);
return 0;
}
if(strval(text) == 9)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid,CMDST);
TextDrawShowForPlayer(playerid, CMDSTR9);
return 0;
}
if(strval(text) == 10)
{
OnCommandList[playerid]=2;
TextDrawHideForPlayer(playerid,CMDST);
TextDrawShowForPlayer(playerid, CMDSTR10);
return 0;
}
}
1. Police cmds
2. Robberies
3. Bank cmds
4. blah blah
5. blah blah
7. blah blah
8. blah blah
the problem is when i do type 1 or 2 or 3 or 4, they don't work. but when i do 5 they work they show me 5. blah blah cmds.
on the top i post my all onplayertext .. when i added house textdraw cmds on player text so i got that bugged. how to fix it? help? i tried alots time but failed.
Guyz i need help rly i can't fixed it or if u dnt understand i will explain u more but please help me.