Dynamic Giftbox Bug -
Yander - 15.05.2014
******* Link:
Dynamic Giftbox Bug(IGRP)
Код:
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\nTo reach inside.",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 are not authorized to use that 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;
}
Re: Dynamic Giftbox Bug -
Beckett - 15.05.2014
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
return 1;
}
You are checking if the player is in a vehicle, if yes then you send this message..
pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
return 1;
}
Opposite.
Re: Dynamic Giftbox Bug -
Yander - 15.05.2014
Код:
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(4000) : warning 235: public function lacks forward declaration (symbol "Audio_OnSetPack")
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(48240) : warning 217: loose indentation
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(48259) : warning 209: function "cmd_dynamicgift" should return a value
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(48260) : error 010: invalid function or declaration
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(48262) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(48264) : error 010: invalid function or declaration
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\SSRP.pwn(73956) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Got the three errors
Re: Dynamic Giftbox Bug -
Beckett - 15.05.2014
Show me the whole code, what did you do.
Re: Dynamic Giftbox Bug -
Yander - 15.05.2014
Код:
CMD:dynamicgift(playerid, params[])
{
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\nTo reach inside.",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 are not authorized to use that command!");
}
return 1;
}
Re: Dynamic Giftbox Bug -
Beckett - 15.05.2014
You have a missing bracket.
pawn Код:
CMD:dynamicgift(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
{
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\nTo reach inside.",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);
}
}// This has no open.
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
return 1;
}
return 1;
}
Re: Dynamic Giftbox Bug -
Yander - 15.05.2014
Код:
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(4000) : warning 235: public function lacks forward declaration (symbol "Audio_OnSetPack")
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(48261) : error 010: invalid function or declaration
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(48263) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(48264) : error 010: invalid function or declaration
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(48268) : error 010: invalid function or declaration
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(73960) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
CMD:dynamicgift(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
{
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\nTo reach inside.",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);
}
}// This has no open.
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
return 1;
}
return 1;
}
Re: Dynamic Giftbox Bug -
Yander - 15.05.2014
Код:
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(4000) : warning 235: public function lacks forward declaration (symbol "Audio_OnSetPack")
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(48255) : error 029: invalid expression, assumed zero
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(48263) : warning 217: loose indentation
C:\Users\JohnMark\Desktop\IGRP Script\gamemodes\IGRP.pwn(73959) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Код:
CMD:dynamicgift(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
{
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\nTo reach inside.",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 are not authorized to use that command!");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
return 1;
}
return 1;
}