04.11.2015, 03:07
tired try all way to fix
it work on player id 0 only
help lz i do some thing wrong ? or ? cause before it work normally i don't know i do some thing wrong
sa-mp 0.3.7
mycode
progress bar & Textdraw
onplayer connect
SetPlayerSpawn
OnPlayerDisconnect
All update Text And Bar
it work on player id 0 only
help lz i do some thing wrong ? or ? cause before it work normally i don't know i do some thing wrong
sa-mp 0.3.7
mycode
progress bar & Textdraw
onplayer connect
Код:
new PlayerBar:BarHungry; new PlayerBar:BarSleep; new PlayerBar:BarDefecate; new Text:SleepBar[MAX_PLAYERS]; new Text:HungryBar[MAX_PLAYERS]; new PlayerText:DefecateBar[MAX_PLAYERS]; public OnPlayerConnect(playerid) { //Delete Object for Otto Car in Los santos RemoveBuildingForPlayer(playerid, 5967, 1259.4375, -1246.8125, 17.1094, 0.25); RemoveBuildingForPlayer(playerid, 1388, 1238.4000, -1258.3000, 57.2000, 0.25); RemoveBuildingForPlayer(playerid, 1391, 1238.3750, -1258.2734, 44.6641, 0.25); RemoveBuildingForPlayer(playerid, 1294, 1254.6875, -1276.1641, 17.0781, 0.25); RemoveBuildingForPlayer(playerid, 5857, 1259.4375, -1246.8125, 17.1094, 0.25); //Prison Los Santos RemoveBuildingForPlayer(playerid, 14843, 266.3516, 81.1953, 1001.2813, 0.25); //Prison Door //Door FBI San Fierro RemoveBuildingForPlayer(playerid, 966, -1572.2031, 658.83594, 6.07813, 6.0111284); RemoveBuildingForPlayer(playerid, 966, -1701.4297, 687.59375, 23.88281, 6.0111284); //Door Royal Army San Fierro RemoveBuildingForPlayer(playerid, 966, -1526.3906, 481.38281, 6.17969, 6.0111284); RemoveBuildingForPlayer(playerid, 968, -1526.4375, 481.38281, 6.90625, 5.576333); //Trees in SAMD Los Santos Area RemoveBuildingForPlayer(playerid, 739, 1231.1406, -1356.2109, 12.73438, 40.473133); RemoveBuildingForPlayer(playerid, 620, 1222.6641, -1374.6094, 12.29688, 22.657042); RemoveBuildingForPlayer(playerid, 620, 1222.6641, -1335.0547, 12.29688, 22.657042); RemoveBuildingForPlayer(playerid, 620, 1240.9219, -1356.5547, 12.29688, 22.657042); RemoveBuildingForPlayer(playerid, 620, 1240.9219, -1317.7422, 12.29688, 22.657042); RemoveBuildingForPlayer(playerid, 620, 1222.6641, -1300.9219, 12.29688, 22.657042); RemoveBuildingForPlayer(playerid, 620, 1184.0078, -1353.5, 12.57813, 22.657042); //Motel in Lossan tos Is Licenmanager RemoveBuildingForPlayer(playerid, 6056, 701.4375, -1417.125, 17.66406, 7.9010029); //Dellimore /*RemoveBuildingForPlayer(playerid, 13243, 705.039, -503.468, 15.335, 0.250); RemoveBuildingForPlayer(playerid, 13137, 646.164, -527.898, 28.070, 0.250); RemoveBuildingForPlayer(playerid, 1294, 712.835, -521.335, 19.703, 0.250); RemoveBuildingForPlayer(playerid, 1688, 706.242, -507.773, 21.289, 0.250); RemoveBuildingForPlayer(playerid, 1690, 706.132, -510.289, 20.976, 0.250); RemoveBuildingForPlayer(playerid, 1308, 711.875, -516.265, 15.617, 0.250); RemoveBuildingForPlayer(playerid, 1308, 691.648, -500.210, 15.687, 0.250); RemoveBuildingForPlayer(playerid, 1294, 700.617, -493.546, 19.851, 0.250); RemoveBuildingForPlayer(playerid, 1687, 696.070, -502.281, 20.132, 0.250); RemoveBuildingForPlayer(playerid, 781, 692.695, -498.234, 15.531, 0.250); RemoveBuildingForPlayer(playerid, 781, 697.812, -498.359, 15.531, 0.250); RemoveBuildingForPlayer(playerid, 12979, 705.039, -503.468, 15.335, 0.250);*/ //END SET 0; //Setplayer Color SetPlayerColor(playerid,COLOR_BLACK); //Progress bar BarHungry = CreatePlayerProgressBar(playerid, 219.00, 408.00, 43.50, 2.50, 0x00800000, 100.0, BAR_DIRECTION_RIGHT); BarSleep = CreatePlayerProgressBar(playerid, 155.00, 408.00, 43.50, 2.50, 0x00800000, 100.0, BAR_DIRECTION_RIGHT); BarDefecate = CreatePlayerProgressBar(playerid, 281.00, 408.00, 43.50, 2.50, 0x00800000, 100.0, BAR_DIRECTION_RIGHT); //TEXT NameVeh[playerid] = TextDrawCreate(478.000000, 411.000000, "_"); TextDrawBackgroundColor(NameVeh[playerid], 255); TextDrawFont(NameVeh[playerid], 1); TextDrawLetterSize(NameVeh[playerid], 0.289999, 0.799999); TextDrawColor(NameVeh[playerid], -1); TextDrawSetOutline(NameVeh[playerid], 0); TextDrawSetProportional(NameVeh[playerid], 1); TextDrawSetShadow(NameVeh[playerid], 1); TextDrawUseBox(NameVeh[playerid], 1); TextDrawBoxColor(NameVeh[playerid], -869033616); TextDrawTextSize(NameVeh[playerid], 546.000000, 0.000000); ShowVeh[playerid] = TextDrawCreate(493.000000, 399.000000, " "); TextDrawBackgroundColor(ShowVeh[playerid], 255); TextDrawFont(ShowVeh[playerid], 1); TextDrawLetterSize(ShowVeh[playerid], 0.179998, 0.899999); TextDrawColor(ShowVeh[playerid], -1); TextDrawSetOutline(ShowVeh[playerid], 0); TextDrawSetProportional(ShowVeh[playerid], 1); TextDrawSetShadow(ShowVeh[playerid], 1); TextDrawUseBox(ShowVeh[playerid], 1); TextDrawBoxColor(ShowVeh[playerid], 112); TextDrawTextSize(ShowVeh[playerid], 640.000000, -5.000000); MoneyText[playerid] = TextDrawCreate(608.000000,95.000000,"-1000"); TextDrawAlignment(MoneyText[playerid],3); TextDrawBackgroundColor(MoneyText[playerid],0x000000ff); TextDrawFont(MoneyText[playerid],3); TextDrawLetterSize(MoneyText[playerid],0.575999,2.230000); TextDrawColor(MoneyText[playerid],0xff000099); TextDrawSetOutline(MoneyText[playerid],1); TextDrawSetShadow(MoneyText[playerid],10); WMoneyText[playerid] = TextDrawCreate(608.000000,122.000000,"-1000"); TextDrawAlignment(WMoneyText[playerid],3); TextDrawBackgroundColor(WMoneyText[playerid],0x000000ff); TextDrawFont(WMoneyText[playerid],3); TextDrawLetterSize(WMoneyText[playerid],0.575999,2.230000); TextDrawColor(WMoneyText[playerid],0xff000099); TextDrawSetOutline(WMoneyText[playerid],1); TextDrawSetShadow(WMoneyText[playerid],10); Respectrank[playerid] = TextDrawCreate(156.000000, 375.822235, "_"); TextDrawBackgroundColor(Respectrank[playerid], 51); TextDrawFont(Respectrank[playerid], 1); TextDrawLetterSize(Respectrank[playerid], 0.185000, 1.226666); TextDrawColor(Respectrank[playerid], -2147483393); TextDrawSetOutline(Respectrank[playerid], 1); TextDrawSetProportional(Respectrank[playerid], 1); TextDrawSetShadow(Respectrank[playerid], 0); TextDrawAlignment(Respectrank[playerid], 1); BarRespect[playerid] = TextDrawCreate(223.000000, 377.944427, "_"); TextDrawLetterSize(BarRespect[playerid], 0.000000, 0.842594); TextDrawTextSize(BarRespect[playerid], 150.500000, 0.000000); TextDrawAlignment(BarRespect[playerid], 1); TextDrawColor(BarRespect[playerid], 0); TextDrawUseBox(BarRespect[playerid], true); TextDrawBoxColor(BarRespect[playerid], 102); TextDrawSetShadow(BarRespect[playerid], 0); TextDrawSetOutline(BarRespect[playerid], 0); TextDrawFont(BarRespect[playerid], 1); Respect[playerid] = TextDrawCreate(157.000000, 365.866607, "_"); TextDrawBackgroundColor(Respect[playerid], 51); TextDrawFont(Respect[playerid], 1); TextDrawLetterSize(Respect[playerid], 0.190000, 0.899999); TextDrawColor(Respect[playerid], -1); TextDrawSetOutline(Respect[playerid], 1); TextDrawSetProportional(Respect[playerid], 1); TextDrawSetShadow(Respect[playerid], 1); SleepBar[playerid] = TextDrawCreate(157.000000, 396.000000, "_"); TextDrawBackgroundColor(SleepBar[playerid], 51); TextDrawFont(SleepBar[playerid], 1); TextDrawLetterSize(SleepBar[playerid], 0.190000, 0.899999); TextDrawColor(SleepBar[playerid], -1); TextDrawSetOutline(SleepBar[playerid], 1); TextDrawSetProportional(SleepBar[playerid], 1); TextDrawSetShadow(SleepBar[playerid], 1); HungryBar[playerid] = TextDrawCreate(220.000000, 396.000000, "_"); TextDrawBackgroundColor(HungryBar[playerid], 51); TextDrawFont(HungryBar[playerid], 1); TextDrawLetterSize(HungryBar[playerid], 0.190000, 0.899999); TextDrawColor(HungryBar[playerid], -1); TextDrawSetOutline(HungryBar[playerid], 1); TextDrawSetProportional(HungryBar[playerid], 1); TextDrawSetShadow(HungryBar[playerid], 1); for(new i = 0; i < MAX_PLAYERS; i++) { DefecateBar[i] = CreatePlayerTextDraw(i, 280.500000, 396.000000, "_"); PlayerTextDrawLetterSize(i, DefecateBar[i], 0.190000, 0.899999); PlayerTextDrawAlignment(i, DefecateBar[i], 1); PlayerTextDrawColor(i, DefecateBar[i], -1); PlayerTextDrawSetShadow(i, DefecateBar[i], 0); PlayerTextDrawSetOutline(i, DefecateBar[i], 1); PlayerTextDrawBackgroundColor(i, DefecateBar[i], 51); PlayerTextDrawFont(i, DefecateBar[i], 1); PlayerTextDrawSetProportional(i, DefecateBar[i], 1); } //END TEXT //== Dynamic House System hUp[playerid] = TextDrawCreate(260.000000, 363.000000, " House Upgrade~n~~n~~r~< ~w~Price: ~g~$90000 ~r~>"); TextDrawBackgroundColor(hUp[playerid], 255); TextDrawFont(hUp[playerid], 2); TextDrawLetterSize(hUp[playerid], 0.349999, 1.200000); TextDrawColor(hUp[playerid], -1); TextDrawSetOutline(hUp[playerid], 1); TextDrawSetProportional(hUp[playerid], 1); LockTD0[playerid] = TextDrawCreate(37.000000, 150.000000, "~n~"); TextDrawBackgroundColor(LockTD0[playerid], 255); TextDrawFont(LockTD0[playerid], 1); TextDrawLetterSize(LockTD0[playerid], 0.500000, 6.899999); TextDrawColor(LockTD0[playerid], -1); TextDrawSetOutline(LockTD0[playerid], 0); TextDrawSetProportional(LockTD0[playerid], 1); TextDrawSetShadow(LockTD0[playerid], 1); TextDrawUseBox(LockTD0[playerid], 1); TextDrawBoxColor(LockTD0[playerid], -206); TextDrawTextSize(LockTD0[playerid], 150.000000, 0.000000); LockTD1[playerid] = TextDrawCreate(47.000000, 162.000000, "~n~"); TextDrawBackgroundColor(LockTD1[playerid], 255); TextDrawFont(LockTD1[playerid], 1); TextDrawLetterSize(LockTD1[playerid], 0.500000, 3.399998); TextDrawColor(LockTD1[playerid], -1); TextDrawSetOutline(LockTD1[playerid], 0); TextDrawSetProportional(LockTD1[playerid], 1); TextDrawSetShadow(LockTD1[playerid], 1); TextDrawUseBox(LockTD1[playerid], 1); TextDrawBoxColor(LockTD1[playerid], -1633968897); TextDrawTextSize(LockTD1[playerid], 79.000000, 10.000000); LockTD2[playerid] = TextDrawCreate(45.000000, 171.000000, "1234"); TextDrawBackgroundColor(LockTD2[playerid], 255); TextDrawFont(LockTD2[playerid], 3); TextDrawLetterSize(LockTD2[playerid], 0.380000, 0.899999); TextDrawColor(LockTD2[playerid], -1199695105); TextDrawSetOutline(LockTD2[playerid], 1); TextDrawSetProportional(LockTD2[playerid], 1); LockTD3[playerid] = TextDrawCreate(95.000000, 157.000000, "~r~1 ~w~2 3~n~4 5 6~n~7 8 9~n~ 0"); TextDrawBackgroundColor(LockTD3[playerid], 255); TextDrawFont(LockTD3[playerid], 1); TextDrawLetterSize(LockTD3[playerid], 0.450000, 1.000000); TextDrawColor(LockTD3[playerid], -1); TextDrawSetOutline(LockTD3[playerid], 1); TextDrawSetProportional(LockTD3[playerid], 1); LockTD4[playerid] = TextDrawCreate(44.000000, 200.000000, "Enter Close"); TextDrawBackgroundColor(LockTD4[playerid], 255); TextDrawFont(LockTD4[playerid], 1); TextDrawLetterSize(LockTD4[playerid], 0.460000, 1.000000); TextDrawColor(LockTD4[playerid], -1); TextDrawSetOutline(LockTD4[playerid], 1); TextDrawSetProportional(LockTD4[playerid], 1); LockTD5[playerid] = TextDrawCreate(34.000000, 149.000000, "~n~"); TextDrawBackgroundColor(LockTD5[playerid], 255); TextDrawFont(LockTD5[playerid], 1); TextDrawLetterSize(LockTD5[playerid], 0.500000, -0.400000); TextDrawColor(LockTD5[playerid], -1); TextDrawSetOutline(LockTD5[playerid], 0); TextDrawSetProportional(LockTD5[playerid], 1); TextDrawSetShadow(LockTD5[playerid], 1); TextDrawUseBox(LockTD5[playerid], 1); TextDrawBoxColor(LockTD5[playerid], -1166599937); TextDrawTextSize(LockTD5[playerid], 153.000000, 0.000000); LockTD6[playerid] = TextDrawCreate(34.000000, 217.000000, "~n~"); TextDrawBackgroundColor(LockTD6[playerid], 255); TextDrawFont(LockTD6[playerid], 1); TextDrawLetterSize(LockTD6[playerid], 0.500000, -0.400000); TextDrawColor(LockTD6[playerid], -1); TextDrawSetOutline(LockTD6[playerid], 0); TextDrawSetProportional(LockTD6[playerid], 1); TextDrawSetShadow(LockTD6[playerid], 1); TextDrawUseBox(LockTD6[playerid], 1); TextDrawBoxColor(LockTD6[playerid], -1166599937); TextDrawTextSize(LockTD6[playerid], 153.000000, 0.000000); //END DigiHP[playerid] = TextDrawCreate(566.000000, 67.000000, "100"); TextDrawBackgroundColor(DigiHP[playerid], 255); TextDrawFont(DigiHP[playerid], 1); TextDrawLetterSize(DigiHP[playerid], 0.340000, 0.799998); TextDrawColor(DigiHP[playerid], -6291201); TextDrawSetOutline(DigiHP[playerid], 1); TextDrawSetProportional(DigiHP[playerid], 1); DigiAP[playerid] = TextDrawCreate(566.000000, 45.000000, "100"); TextDrawBackgroundColor(DigiAP[playerid], 255); TextDrawFont(DigiAP[playerid], 1); TextDrawLetterSize(DigiAP[playerid], 0.340000, 0.799998); TextDrawColor(DigiAP[playerid], 1778319615); TextDrawSetOutline(DigiAP[playerid], 1); TextDrawSetProportional(DigiAP[playerid], 1); SpreeTextdraw[0] = TextDrawCreate(521.000000, 291.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[0], 255); TextDrawFont(SpreeTextdraw[0], 1); TextDrawLetterSize(SpreeTextdraw[0], 3.319998, 10.300001); TextDrawColor(SpreeTextdraw[0], -16776961); TextDrawSetOutline(SpreeTextdraw[0], 1); TextDrawSetProportional(SpreeTextdraw[0], 1); SpreeTextdraw[1] = TextDrawCreate(514.000000, 287.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[1], 255); TextDrawFont(SpreeTextdraw[1], 1); TextDrawLetterSize(SpreeTextdraw[1], 1.770000, 5.600000); TextDrawColor(SpreeTextdraw[1], -16776961); TextDrawSetOutline(SpreeTextdraw[1], 1); TextDrawSetProportional(SpreeTextdraw[1], 1); SpreeTextdraw[2] = TextDrawCreate(571.000000, 329.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[2], 255); TextDrawFont(SpreeTextdraw[2], 1); TextDrawLetterSize(SpreeTextdraw[2], 1.770000, 5.600000); TextDrawColor(SpreeTextdraw[2], -16776961); TextDrawSetOutline(SpreeTextdraw[2], 1); TextDrawSetProportional(SpreeTextdraw[2], 1); SpreeTextdraw[3] = TextDrawCreate(595.000000, 323.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[3], 255); TextDrawFont(SpreeTextdraw[3], 1); TextDrawLetterSize(SpreeTextdraw[3], 0.960000, 3.300000); TextDrawColor(SpreeTextdraw[3], -16776961); TextDrawSetOutline(SpreeTextdraw[3], 1); TextDrawSetProportional(SpreeTextdraw[3], 1); SpreeTextdraw[4] = TextDrawCreate(521.000000, 291.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[4], -16776961); TextDrawFont(SpreeTextdraw[4], 1); TextDrawLetterSize(SpreeTextdraw[4], 3.319998, 10.300001); TextDrawColor(SpreeTextdraw[4], -16776961); TextDrawSetOutline(SpreeTextdraw[4], 0); TextDrawSetProportional(SpreeTextdraw[4], 1); TextDrawSetShadow(SpreeTextdraw[4], 1); SpreeTextdraw[5] = TextDrawCreate(514.000000, 287.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[5], -16776961); TextDrawFont(SpreeTextdraw[5], 1); TextDrawLetterSize(SpreeTextdraw[5], 1.770000, 5.600000); TextDrawColor(SpreeTextdraw[5], -16776961); TextDrawSetOutline(SpreeTextdraw[5], 0); TextDrawSetProportional(SpreeTextdraw[5], 1); TextDrawSetShadow(SpreeTextdraw[5], 1); SpreeTextdraw[6] = TextDrawCreate(571.000000, 329.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[6], -16776961); TextDrawFont(SpreeTextdraw[6], 1); TextDrawLetterSize(SpreeTextdraw[6], 1.770000, 5.600000); TextDrawColor(SpreeTextdraw[6], -16776961); TextDrawSetOutline(SpreeTextdraw[6], 0); TextDrawSetProportional(SpreeTextdraw[6], 1); TextDrawSetShadow(SpreeTextdraw[6], 1); SpreeTextdraw[7] = TextDrawCreate(595.000000, 323.000000, "0"); TextDrawBackgroundColor(SpreeTextdraw[7], -16776961); TextDrawFont(SpreeTextdraw[7], 1); TextDrawLetterSize(SpreeTextdraw[7], 0.960000, 3.300000); TextDrawColor(SpreeTextdraw[7], -16776961); TextDrawSetOutline(SpreeTextdraw[7], 0); TextDrawSetProportional(SpreeTextdraw[7], 1); TextDrawSetShadow(SpreeTextdraw[7], 1); SpreeTextdraw[8] = TextDrawCreate(529.000000, 198.000000, "."); TextDrawBackgroundColor(SpreeTextdraw[8], -16776961); TextDrawFont(SpreeTextdraw[8], 1); TextDrawLetterSize(SpreeTextdraw[8], 5.279999, 20.299997); TextDrawColor(SpreeTextdraw[8], -16776961); TextDrawSetOutline(SpreeTextdraw[8], 1); TextDrawSetProportional(SpreeTextdraw[8], 1); SpreeTextdraw[9] = TextDrawCreate(515.000000, 240.000000, "."); TextDrawBackgroundColor(SpreeTextdraw[9], -16776961); TextDrawFont(SpreeTextdraw[9], 1); TextDrawLetterSize(SpreeTextdraw[9], 2.870001, 11.299997); TextDrawColor(SpreeTextdraw[9], -16776961); TextDrawSetOutline(SpreeTextdraw[9], 1); TextDrawSetProportional(SpreeTextdraw[9], 1); SpreeTextdraw[10] = TextDrawCreate(574.000000, 279.000000, "."); TextDrawBackgroundColor(SpreeTextdraw[10], -16776961); TextDrawFont(SpreeTextdraw[10], 1); TextDrawLetterSize(SpreeTextdraw[10], 2.870001, 11.299997); TextDrawColor(SpreeTextdraw[10], -16776961); TextDrawSetOutline(SpreeTextdraw[10], 1); TextDrawSetProportional(SpreeTextdraw[10], 1); SpreeTextdraw[11] = TextDrawCreate(598.000000, 297.000000, "."); TextDrawBackgroundColor(SpreeTextdraw[11], -16776961); TextDrawFont(SpreeTextdraw[11], 1); TextDrawLetterSize(SpreeTextdraw[11], 1.540002, 5.999996); TextDrawColor(SpreeTextdraw[11], -16776961); TextDrawSetOutline(SpreeTextdraw[11], 1); TextDrawSetProportional(SpreeTextdraw[11], 1); SpreeTextdraw[12] = TextDrawCreate(528.000000, 325.000000, "~b~[pRo]RoboCop ~w~- ~n~~g~Dominating ~w~with ~y~3 kills"); TextDrawAlignment(SpreeTextdraw[12], 2); TextDrawBackgroundColor(SpreeTextdraw[12], 255); TextDrawFont(SpreeTextdraw[12], 2); TextDrawLetterSize(SpreeTextdraw[12], 0.280000, 1.699999); TextDrawColor(SpreeTextdraw[12], -1); TextDrawSetOutline(SpreeTextdraw[12], 1); TextDrawSetProportional(SpreeTextdraw[12], 1); MySQLCheckConnection(); new plname[MAX_PLAYER_NAME]; GetPlayerName(playerid, plname, sizeof(plname)); new sqlaccountstatus = MySQLCheckAccount(plname); if(sqlaccountstatus != 0) { if (MySQLCheckAccountBanned(sqlaccountstatus) == 1) { SendClientMessage(playerid, COLOR_SUPERRED, "в»Гґ·ГТє: Account №Хй¶ЩЎбє№... ЎГШіТµФґµиНКНє¶ТБ Administrator !"); PlayerInfo[playerid][pKicked] = 1; return 1; } // Check if the account is locked gPlayerAccount[playerid] = 1; PlayerInfo[playerid][pSQLID] = sqlaccountstatus; } else { gPlayerAccount[playerid] = 0; } //Amunation GTA IV RemoveBuildingForPlayer(playerid, 1885, 310.1250, -166.2109, 998.5547, 0.25); RemoveBuildingForPlayer(playerid, 1885, 315.2422, -169.8984, 998.5547, 0.25); RemoveBuildingForPlayer(playerid, 18105, 312.9844, -163.2500, 1000.5547, 0.25); RemoveBuildingForPlayer(playerid, 1886, 318.8047, -158.9297, 1003.2266, 0.25); SetTimerEx("CheckForPlayerPos", 100, 1, "i", playerid); /*SetPVarInt( playerid, "bCon", 1 ); #if defined TELL_ON_CONNECT true P_DATA[ playerid ][ P_Logged ] = 0; P_DATA[ playerid ][ P_Deposited ] = 0; P_DATA[ playerid ][ P_Withdraw ] = 0; P_DATA[ playerid ][ P_Transfered] = 0; if ( fexist( ReturnBankingName( playerid ) ) ) SendClientMessage( playerid, 0x20FF20FF, "Banking: {FFFFFF}You have a bank account! Please use {20FF20}/bank{FFFFFF} to login"); else SendClientMessage( playerid, 0x20FF20FF, "Banking: {FFFFFF}You don't have a bank account! Please use {20FF20}/bank{FFFFFF} to register an account"); #endif*/ return 1; }
Код:
public SetPlayerSpawn(playerid) { new randompoints; if(IsPlayerConnected(playerid)) { TextDrawShowForPlayer(playerid, SleepBar[playerid]); TextDrawShowForPlayer(playerid, HungryBar[playerid]); TextDrawShowForPlayer(playerid, Respect[playerid]); TextDrawShowForPlayer(playerid, Respectrank[playerid]); TextDrawShowForPlayer(playerid, BarRespect[playerid]); PlayerTextDrawShow(playerid, DefecateBar[playerid]); ShowPlayerProgressBar(playerid, BarHungry); ShowPlayerProgressBar(playerid, BarSleep); ShowPlayerProgressBar(playerid, BarDefecate); TextDrawShowForPlayer(playerid, versionsit); TextDrawShowForPlayer(playerid, versionsit1); TextDrawShowForPlayer(playerid, versionsit2); TextDrawShowForPlayer(playerid, Zones[playerid]); TextDrawShowForPlayer(playerid, DigiHP[playerid]); new Float:Armour; GetPlayerArmour(playerid, Armour); if(Armour >= 1) TextDrawShowForPlayer(playerid, DigiAP[playerid]); else TextDrawHideForPlayer(playerid, DigiAP[playerid]); if(PlayerInfo[playerid][pHospitalized] >= 1) { if(Event[playerid] >= 1) { new rand = random(sizeof(DeathMathSpawn)); SetPlayerPos(playerid,DeathMathSpawn[rand][0],DeathMathSpawn[rand][1],DeathMathSpawn[rand][2]); SetPlayerInterior(playerid,10); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 0); SafeResetPlayerWeapons(playerid); PlayerInfo[playerid][pHospitalized] = 0; if(DeathMWeapons == 0) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 14, 1); } } else if(DeathMWeapons == 1) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 31, 400); } } else if(DeathMWeapons == 2) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 29, 400); } } else if(DeathMWeapons == 3) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 24, 400); } } else if(DeathMWeapons == 4) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 8, 1); } } else if(DeathMWeapons == 5) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 9, 1); } } else if(DeathMWeapons == 6) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 30, 400); } } else if(DeathMWeapons == 7) { if(Event[playerid] >= 1) { SafeGivePlayerWeapon(playerid, 5, 1); } } return 1; } SetPlayerPos(playerid, Hospitalizedpoints[randompoints][0], Hospitalizedpoints[randompoints][1], Hospitalizedpoints[randompoints][2]); initiateHospital(playerid); return 1; } if(PlayerInfo[playerid][pJob] == 4) { if(Mechanic[playerid] == 0) { Mechanics += 1; Mechanic[playerid] = 1; } } if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2) { if(Medic[playerid] == 0) { Medics += 1; Medic[playerid] = 1; } } if(PlayerInfo[playerid][pJob] == 8) { if(ChickBoy[playerid] == 0) { ChickBoys += 1; ChickBoy[playerid] = 1; } } if(PlayerInfo[playerid][pJob] == 7) { if(PizzaBoy[playerid] == 0) { PizzaBoys += 1; PizzaBoy[playerid] = 1; } } if(PlayerInfo[playerid][pDonateRank] >= 1) { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]); PlayerInfo[playerid][pInt] = PlayerInfo[playerid][pInt]; PlayerInfo[playerid][pLocal] = 255; SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z] + 1); return 1; } if(PlayerInfo[playerid][pCrashed] == 1) { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]); PlayerInfo[playerid][pInt] = PlayerInfo[playerid][pInt]; PlayerInfo[playerid][pLocal] = 255; SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1); PlayerInfo[playerid][pCrashed] = 0; return 1; } //== Dynamic House System new h = PlayerInfo[playerid][pPhousekey]; if(PlayerInfo[playerid][pOrigin] == 1) { SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]); SetPlayerInterior(playerid,House[h][IntID]); SetPlayerVirtualWorld(playerid,House[h][VW]); return 1; } if(PlayerInfo[playerid][pOrigin] == 2) { if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1) //ЁШґаЎФґ SAPD { if(OnDuty[playerid] >= 1) { SetPlayerColor(playerid, 0x00808000); } else { SetPlayerToTeamColor(playerid); } SetPlayerInterior(playerid,6); PlayerInfo[playerid][pInt] = 6; PlayerInfo[playerid][pLocal] = 1006; SetPlayerPos(playerid, 240.1766,71.7774,1005.0391); return 1; } if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2) //ЁШґаЎФґ SAMD { if(OnDuty[playerid] >= 1) { SetPlayerColor(playerid, 0xB5FBE600); } else { SetPlayerToTeamColor(playerid); } SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,22); PlayerInfo[playerid][pInt] = 22; PlayerInfo[playerid][pLocal] = 1022; SetPlayerPos(playerid, 328.2903,1030.1633,2305.3103); return 1; } else { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 0; SetPlayerPos(playerid, 695.2477,-497.9818,16.3359); } } else if(PlayerInfo[playerid][pOrigin] == 0) { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 0; SetPlayerPos(playerid, 695.2477,-497.9818,16.3359); } SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 0; SetPlayerPos(playerid, 695.2477,-497.9818,16.3359); } return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { switch(reason) { case 0: { GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]); PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid); PlayerInfo[playerid][pCrashed] = 1; new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); new join[256]; new IP[128]; GetPlayerIp(playerid, IP, sizeof(IP)); format(join,sizeof(join),"*~[Scar of San Andreas Security]: "COL_WHITE" %s IP: %s has leave server (Crash)",pName,IP); SendAdminMessage(COLOR_YELLOW,join); } case 1: { new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); new join[256]; new IP[128]; GetPlayerIp(playerid, IP, sizeof(IP)); format(join,sizeof(join),"*~[Scar of San Andreas Security]: "COL_WHITE" %s IP: %s has leave server (Out)",pName,IP); SendAdminMessage(COLOR_YELLOW,join); } } if(PlayerInfo[playerid][pDonateRank] >= 1) { PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid); GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]); } if(SAPDInPosition[playerid] == 1) { SAPDInPosition[playerid] = 0; } if(SAMDInPosition[playerid] == 1) { SAMDInPosition[playerid] = 0; } if(SAMDInPositionR1[playerid] == 1) { SAMDInPositionR1[playerid] = 0; R1 = 0; } if(SAMDInPositionR2[playerid] == 1) { SAMDInPositionR2[playerid] = 0; R2 = 0; } /*if(isAdminIcon[playerid] == 1) { isAdminIcon[playerid] = 0; }*/ for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { /*if(TaxiAccepted[i] < 999) { if(TaxiAccepted[i] == playerid) { TaxiAccepted[i] = 999; GameTextForPlayer(i, "~w~Taxi Caller~n~~r~Left the game", 5000, 1); TaxiCallTime[i] = 0; DisablePlayerCheckpoint(i); } } else if(BusAccepted[i] < 999) { if(BusAccepted[i] == playerid) { BusAccepted[i] = 999; GameTextForPlayer(i, "~w~Bus Caller~n~~r~Left the game", 5000, 1); BusCallTime[i] = 0; DisablePlayerCheckpoint(i); } }*/ if(MedicAccepted[i] < 999) { if(MedicAccepted[i] == playerid) { MedicAccepted[i] = 999; GameTextForPlayer(i, "~w~Medic Caller~n~~r~Left the game", 5000, 1); MedicCallTime[i] = 0; DisablePlayerCheckpoint(i); } } else if(ChickAccepted[i] < 999) { if(ChickAccepted[i] == playerid) { ChickAccepted[i] = 999; GameTextForPlayer(i, "~w~Chick Caller~n~~r~Left the game", 5000, 1); ChickCallTime[i] = 0; DisablePlayerCheckpoint(i); } } else if(PizzaAccepted[i] < 999) { if(PizzaAccepted[i] == playerid) { PizzaAccepted[i] = 999; GameTextForPlayer(i, "~w~Chick Caller~n~~r~Left the game", 5000, 1); PizzaCallTime[i] = 0; DisablePlayerCheckpoint(i); } } } } OnAccountUpdate(playerid); gPlayerLogged[playerid] = 0; PlayerInfo[playerid][pTimeonline] = 0; HidePlayerProgressBar(playerid, BarSleep); HidePlayerProgressBar(playerid, BarHungry); //HidePlayerProgressBar(playerid, BarDefecate); SetPlayerWantedLevel(playerid, 0); Delete3DTextLabel(TagDD[playerid]); TagShow[playerid] = 0; Delete3DTextLabel(TagDD2[playerid]); TagShow2[playerid] = 0; Delete3DTextLabel(TagDD3[playerid]); TagShow3[playerid] = 0; Delete3DTextLabel(TagDD4[playerid]); TagShow4[playerid] = 0; Delete3DTextLabel(TagDD5[playerid]); TagShow5[playerid] = 0; TextDrawHideForPlayer(playerid, Clocker); TextDrawHideForPlayer(playerid, SleepBar[playerid]); TextDrawHideForPlayer(playerid, HungryBar[playerid]); //PlayerTextDrawHide(playerid, DefecateBar[playerid]); TextDrawHideForPlayer(playerid, Respect[playerid]); TextDrawHideForPlayer(playerid, Respectrank[playerid]); TextDrawHideForPlayer(playerid, BarRespect[playerid]); TextDrawHideForPlayer(playerid, versionsit); TextDrawHideForPlayer(playerid, versionsit1); TextDrawHideForPlayer(playerid, versionsit2); TextDrawHideForPlayer(playerid, Circle); TextDrawHideForPlayer(playerid, Scar); TextDrawHideForPlayer(playerid, Ssa); TextDrawHideForPlayer(playerid, Ofsa); TextDrawHideForPlayer(playerid, Bmtu); TextDrawHideForPlayer(playerid, Zones[playerid]); ResTagOn[playerid] = 0; Delete3DTextLabel(ResTag[playerid]); Delete3DTextLabel(AFKTAG[playerid]); tazeron[playerid] = 0; KillSpree[playerid] = 0; TextDrawDestroy(DigiHP[playerid]); TextDrawDestroy(DigiAP[playerid]); if(PlayerInfo[playerid][pLocal] != 255) { PlayerInfo[playerid][pLocal] = 255; } if(PlayerInfo[playerid][pJob] == 4) { if(Mechanic[playerid] == 1) { if(Mechanics >= 0) { Mechanics -= 1; Mechanic[playerid] = 0; } } } if(Medic[playerid] == 1) { if(Medics >= 0) { Medics -= 1; Medic[playerid] = 0; } } if(PlayerInfo[playerid][pJob] == 7) { if(PizzaBoy[playerid] == 1) { if(PizzaBoys >= 0) { PizzaBoys -= 1; PizzaBoy[playerid] = 0; } } } if(PlayerInfo[playerid][pJob] == 8) { if(ChickBoy[playerid] == 1) { if(ChickBoys >= 0) { ChickBoys -= 1; ChickBoy[playerid] = 0; } } } if(VehicleGet[playerid] != 999) { if(destas == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInVehicle(i, VehicleGet[playerid])) { RemovePlayerFromVehicle(i); } } } VehicleKey[VehicleGet[playerid]] = 999; VehRespawn[VehicleGet[playerid]] = 0; DestroyVehicle(VehicleGet[playerid]); } } if(VehicleGet2[playerid] != 999) { if(destas == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInVehicle(i, VehicleGet2[playerid])) { RemovePlayerFromVehicle(i); } } } VehicleKey2[VehicleGet2[playerid]] = 999; VehRespawn2[VehicleGet2[playerid]] = 0; DestroyVehicle(VehicleGet2[playerid]); } } if(VehicleGet3[playerid] != 999) { if(destas == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInVehicle(i, VehicleGet3[playerid])) { RemovePlayerFromVehicle(i); } } } VehicleKey3[VehicleGet3[playerid]] = 999; VehRespawn3[VehicleGet3[playerid]] = 0; DestroyVehicle(VehicleGet3[playerid]); } } if(VehicleRGet[playerid] != 999) { if(destas == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInVehicle(i, VehicleRGet[playerid])) { RemovePlayerFromVehicle(i); } } } VehicleRKey[VehicleRGet[playerid]] = 999; VehRespawnR[VehicleRGet[playerid]] = 0; DestroyVehicle(VehicleRGet[playerid]); } } if(RoadBlock1[playerid]) DestroyDynamicObject(RB1[playerid]); if(RoadBlock2[playerid]) DestroyDynamicObject(RB2[playerid]); if(RoadBlock3[playerid]) DestroyDynamicObject(RB3[playerid]); if(RoadBlock4[playerid]) DestroyDynamicObject(RB4[playerid]); if(RoadBlock5[playerid]) DestroyDynamicObject(RB5[playerid]); if(RoadBlock6[playerid]) DestroyDynamicObject(RB6[playerid]); if(RoadBlock7[playerid]) DestroyDynamicObject(RB7[playerid]); if(RoadBlock8[playerid]) DestroyDynamicObject(RB8[playerid]); if(RoadBlock9[playerid]) DestroyDynamicObject(RB9[playerid]); if(RoadBlock10[playerid]) DestroyDynamicObject(RB10[playerid]); /*#if defined SAVE_ON_EXIT true if ( P_DATA[ playerid ][ P_Logged ] ) { new INI:BankAcc = INI_Open( ReturnBankingName( playerid ) ); INI_WriteInt( BankAcc, "MONEY", P_DATA[ playerid ][ P_Deposited ] ); INI_WriteInt( BankAcc, "WITHDRAW", P_DATA[ playerid ][ P_Withdraw ] ); INI_WriteInt( BankAcc, "TRANSFERED", P_DATA[ playerid ][ P_Transfered ] ); INI_Close( BankAcc ); } #endif*/ return 1; }
All update Text And Bar
Код:
forward UpdateSleep(playerid); forward UpdateHungry(playerid); forward UpdateDefecate(playerid); public UpdateSleep(playerid) { new string[256]; format(string,sizeof(string),"Energy: %d%",PlayerInfo[playerid][pTired]); TextDrawSetString(SleepBar[playerid],string); if(PlayerInfo[playerid][pTired] >= 50) { SetPlayerProgressBarColour(playerid, BarSleep, 0x008000FF); } else if(PlayerInfo[playerid][pTired] <= 49 && PlayerInfo[playerid][pTired] >= 26) { SetPlayerProgressBarColour(playerid, BarSleep, 0xFFFF00FF); } else if(PlayerInfo[playerid][pTired] < 25) { SetPlayerProgressBarColour(playerid, BarSleep, 0xFF0000FF); } SetPlayerProgressBarValue(playerid, BarSleep,PlayerInfo[playerid][pTired]); return 1; } public UpdateHungry(playerid) { new string[256]; format(string,sizeof(string),"Hunger: %d%",PlayerInfo[playerid][pBeFull]); TextDrawSetString(HungryBar[playerid],string); if(PlayerInfo[playerid][pBeFull] >= 50) { SetPlayerProgressBarColour(playerid, BarHungry, 0x008000FF); } else if(PlayerInfo[playerid][pBeFull] <= 49 && PlayerInfo[playerid][pTired] >= 26) { SetPlayerProgressBarColour(playerid, BarHungry, 0xFFFF00FF); } else if(PlayerInfo[playerid][pBeFull] < 25) { SetPlayerProgressBarColour(playerid, BarHungry, 0xFF0000FF); } SetPlayerProgressBarValue(playerid, BarHungry,PlayerInfo[playerid][pBeFull]); return 1; } public UpdateDefecate(playerid) { new string[256]; format(string,sizeof(string),"Defecate: %d%",PlayerInfo[playerid][pDefecate]); PlayerTextDrawSetString(playerid, DefecateBar[playerid],string); if(PlayerInfo[playerid][pDefecate] >= 80) { SetPlayerProgressBarColour(playerid, BarDefecate, 0xFF0000FF); } else if(PlayerInfo[playerid][pDefecate] >= 50) { SetPlayerProgressBarColour(playerid, BarDefecate, 0xFFFF00FF); } else if(PlayerInfo[playerid][pDefecate] <= 49) { SetPlayerProgressBarColour(playerid, BarDefecate, 0x008000FF); } SetPlayerProgressBarValue(playerid, BarDefecate,PlayerInfo[playerid][pDefecate]); return 1; }