17.05.2014, 05:25
Код:
CMD:dynamicgift(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command."); return 1; } new string[128], Float:Position[4]; if(dynamicgift == 0) { GetPlayerPos(playerid, Position[0], Position[1], Position[2]); GetPlayerFacingAngle(playerid, Position[3]); dynamicgift = CreateDynamicObject(19054, Position[0], Position[1], Position[2]-0.4, 0.0, 0.0, Position[3], -1, -1, -1, 200.0); dynamicgift3DText = CreateDynamic3DTextLabel("/getgift\nTogetagift.",COLOR_YELLOW,Position[0], Position[1], Position[2]+0.25,8.0); SetPlayerPos(playerid, Position[0], Position[1], Position[2]+3); format(string, sizeof(string), "AdmCmd: %s has placed the dynamic gift.", GetPlayerNameEx(playerid)); ABroadCast( COLOR_LIGHTRED, string, 1337); } else { DestroyDynamicObject(dynamicgift); dynamicgift = 0; DestroyDynamic3DTextLabel( Text3D:dynamicgift3DText ); format(string, sizeof(string), "AdmCmd: %s has destroyed the dynamic gift.", GetPlayerNameEx(playerid)); ABroadCast( COLOR_LIGHTRED, string, 1337); } } else { SendClientMessageEx(playerid, COLOR_GRAD1, "You can not you this command."); } return 1; } CMD:getgift(playerid, params[]) { new string[128]; if(IsPlayerInRangeOfPoint(playerid, 3.0,2546.680908, 1403.430786, 7699.584472)) { if(PlayerInfo[playerid][pDonateRank] >= 1) { if(VIPGifts == 0 && PlayerInfo[playerid][pDonateRank] < 4) { SendClientMessageEx(playerid, COLOR_GRAD2, "The safe is locked!"); return 1; } if(PlayerInfo[playerid][pGiftTime] > 0) { SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!"); return 1; } format(string, sizeof(string), "* %s reaches inside the safe with his eyes closed.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GiftPlayer(500, playerid); } } else if(dynamicgift != 0) { new Float:Position[3]; GetDynamicObjectPos(dynamicgift, Position[0], Position[1], Position[2]); if(IsPlayerInRangeOfPoint(playerid, 5.0, Position[0], Position[1], Position[2])) { if(PlayerInfo[playerid][pLevel] >= 2) { if(PlayerInfo[playerid][pGiftTime] > 0) { SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!"); return 1; } format(string, sizeof(string), "* %s reaches inside the bag of gifts with their eyes closed.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GiftPlayer(500, playerid); } else { SendClientMessageEx(playerid, COLOR_WHITE, "* You must be at least level 2 to use this, sorry!"); } } } return 1; }