(15988) : error 029: invalid expression, assumed zero
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)
{
if(dynamicgift == 0)
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:dynamicgift(playerid, params[]) if(dynamicgift == 0)
if(dynamicgift == 0)
if(true)
|
Hello there.
Код:
CMD:dynamicgift(playerid, params[]) if(dynamicgift == 0) You can not put name of command inside of if() statement. Just try replacing Код:
if(dynamicgift == 0) Код:
if(true) Do you want to check for parameters provided using this command, or what? Greetings. Edition in progress |
if(dynamicgift == 0)
{
then when u calling else function you chould do like this else if(dynamicgift[playerid] == false) new bool:dynamicgift[MAX_PLAYERS] = false;
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[playerid] == false)
{
dynamicgift[playerid] = true;
}
else if (dynamicgift[playerid] == true)
{
dynamicgift[playerid] = false;
}
// Top of the script
new DynamicGiftCreated = false;
new DynamicGiftOBJ;
new Text3D:dynamicgift3DText;
/////
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(!DynamicGiftCreated)
{
GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
GetPlayerFacingAngle(playerid, Position[3]);
DynamicGiftOBJ = 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);
DynamicGiftCreated=true; // Ive forgot to add this..
}
else
{
DestroyDynamicObject(DynamicGiftOBJ);
DynamicGiftCreated = false;
DestroyDynamic3DTextLabel( dynamicgift3DText );
format(string, sizeof(string), "AdmCmd: %s has destroyed the dynamic gift.", GetPlayerNameEx(playerid));
ABroadCast( COLOR_LIGHTRED, string, 1337);
DynamicGiftCreated=false; // This either :<
}
}
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);
}
}
if(PlayerInfo[playerid][pDonateRank] >= 1)
if(VIPGifts == 0 && PlayerInfo[playerid][pDonateRank] < 4)