3 Warnings
#3

Код:
 CMD:destroyboombox(playerid, params[])
{
	if(GetPVarType(playerid, "pBoomBox"))
	{
	    DestroyDynamicObject(GetPVarInt(playerid, "pBoomBox"));
	    DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "pBoomBoxLabel"));
	    DeletePVar(playerid, "pBoomBox"); DeletePVar(playerid, "pBoomBoxStation"); DeletePVar(playerid, "pBoomBoxLabel");
	    DeletePVar(playerid, "pBoomBoxX"); DeletePVar(playerid, "pBoomBoxY"); DeletePVar(playerid, "pBoomBoxZ");
	    if(GetPVarType(playerid, "pBoomBoxArea"))
	    {
         	new string[128];
			format(string, sizeof(string), "* %s has destroyed the boombox.", GetPlayerNameEx(playerid));
	        foreach(Player, i)
	        {
	            if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
	            {
	                StopAudioStreamForPlayer(playerid);
	                SendClientMessage(i, COLOR_PURPLE, string);
				}
			}
	        DeletePVar(playerid, "pBoomBoxArea");
		}
		SendClientMessage(playerid, COLOR_WHITE, "You've destroyed your boombox!");
	}
	else
	{
     foreach(Player, a) // This is line 65281
	    {
	        if(GetPVarType(a, "pBoomBox"))
	        {
				if(GetPVarInt(a, "pBoomBoxVW") == GetPlayerVirtualWorld(playerid) && GetPVarInt(a, "pBoomBoxInt") == GetPlayerInterior(playerid) && IsPlayerInRangeOfPoint(playerid, 5.0, GetPVarFloat(i, "pBoomBoxX"), GetPVarFloat(i, "pBoomBoxY"), GetPVarFloat(i, "pBoomBoxZ")))
				{
				    DestroyDynamicObject(GetPVarInt(i, "pBoomBox"));
				    DestroyDynamic3DTextLabel(Text3D:GetPVarInt(i, "pBoomBoxLabel"));

				    DeletePVar(a, "pBoomBox");
					DeletePVar(a, "pBoomBoxStation");
					DeletePVar(a, "pBoomBoxLabel");
				    DeletePVar(a, "pBoomBoxX");
					DeletePVar(a, "pBoomBoxY");
					DeletePVar(a, "pBoomBoxZ");
					DeletePVar(a, "pBoomBoxInt");
					DeletePVar(a, "pBoomBoxVW");

        			new string[128];
				    if(GetPVarType(a, "pBoomBoxArea"))
				    {
				        format(string, sizeof(string), "* %s has destroyed the boombox.", GetPlayerNameEx(playerid));
				        for(new d = 0; d < MAX_PLAYERS; d++)
				        {
				            if(IsPlayerInDynamicArea(playerid, GetPVarInt(d, "pBoomBoxArea")))
				            {
				                StopAudioStreamForPlayer(playerid);
				                SendClientMessage(playerid, COLOR_PURPLE, string);
							}
						}
				        DeletePVar(d, "pBoomBoxArea");
					}
				    format(string, sizeof(string), "%s has destroyed your boombox!", GetPlayerNameEx(playerid));
				    SendClientMessage(a, COLOR_WHITE, string);
					return 1;
				}
			}
	    }
    	SendClientMessage(playerid, COLOR_WHITE, "You don't have a boombox or you are not near one to destroy."); // this is line 65297
  	}
  	return 1;
}
#pragma unused tracecall
Reply


Messages In This Thread
3 Warnings - by mahdi499 - 01.05.2013, 16:04
Re: 3 Warnings - by SimpalK - 01.05.2013, 16:08
Re: 3 Warnings - by RaZzZzoR - 01.05.2013, 16:10
Re: 3 Warnings - by mahdi499 - 01.05.2013, 16:11
Re: 3 Warnings - by Slix_ - 01.05.2013, 16:15
Re: 3 Warnings - by mahdi499 - 01.05.2013, 16:18
Re: 3 Warnings - by SimpalK - 01.05.2013, 16:18
Re: 3 Warnings - by mahdi499 - 01.05.2013, 16:22
Re: 3 Warnings - by SimpalK - 01.05.2013, 16:23
Re: 3 Warnings - by mahdi499 - 01.05.2013, 16:24

Forum Jump:


Users browsing this thread: 2 Guest(s)