Help with Dynamic giftbox?
#1

Sorry if i double Posted But not enough room anyway' How do i add this i get a error everytime,
Код:
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);
SetPlayerPosEx(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, "Da Bi Khoa!");
return 1;
}
if(PlayerInfo[playerid][pGiftTime] > 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You already get a gift from last 5 hours!");
return 1;
}
format(string, sizeof(string), "* %s has close his eyes and wish a presents.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GiftPlayer(MAX_PLAYERS, 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 already get a gift from last 5 hours!");
return 1;
}
format(string, sizeof(string), "* %s close his eyes and wish a presents.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GiftPlayer(MAX_PLAYERS, playerid);
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "* You need to level 2 to get a gift from box!");
}
}
}
return 1;
}
jasonsmith is online now Add to jasonsmith's Reputation Report Post   	Edit/Delete Message
Reply
#2

Put the code in PAWN tags please.
Reply
#3

Quote:
Originally Posted by Sublime
Посмотреть сообщение
Put the code in PAWN tags please.
ok hold on
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)