CMD errors
#4

Код:
CMD:placeboombox(playerid, params[])
{
	    if(GetPVarInt(playerid, "IsInArena") >= 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
		if(WatchingTV[playerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can not do this while watching TV!");
		if(GetPVarInt(playerid, "Injured") == 1 || PlayerInfo[playerid][pHospital] == 1 || IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
		if(GetPVarType(playerid, "pDynamicBB")) return SendClientMessageEx(playerid, COLOR_WHITE, "You already have a boombox out, use /pickupboombox.");

		foreach(Player, i)
	    {
	        if(GetPVarType(i, "pDynamicBB"))
	        {
    			if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "pDynamicBBX"), GetPVarFloat(i, "pDynamicBBY"), GetPVarFloat(i, "pDynamicBBZ")))
				{
				    SendClientMessage(playerid, COLOR_WHITE, "You are in range of another boombox, you can't place one here!");
				    return 1;
				}
			}
		}
		new string[128];
		format(string, sizeof(string), "%s has placed a boombox!", GetPlayerNameEx(playerid));
	    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

	    new Float:x, Float:y, Float:z, Float:a;
	    GetPlayerPos(playerid, x, y, z);
	    GetPlayerFacingAngle(playerid, a);
	    ApplyAnimation(playerid,"BOMBER","BOM_Plant_Crouch_In", 4.0, 0, 0, 0, 0, 0, 1);
	    x += (2 * floatsin(-a, degrees));
    	y += (2 * floatcos(-a, degrees));
    	z -= 1.0;

	  	SetPVarInt(playerid, "pDynamicBB", CreateDynamicObject(2226, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
        SetPVarFloat(playerid, "pDynamicBBX", x); SetPVarFloat(playerid, "pDynamicBBY", y); SetPVarFloat(playerid, "pDynamicBBZ", z);
        format(string, sizeof(string), "{00FF00}Boombox Owner:{FFFFFF}%s\n{FF0000}/setboombox{FFFFFF} to set your boombox \n{FFFF00}or\n{FF0000}/pickupboombox{FFFFFF}", SenderName(playerid));
        SetPVarInt(playerid, "pDynamicBBLabel", _:CreateDynamic3DTextLabel(string, COLOR_WHITE, x, y, z+0.6, 5.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
        SetPVarInt(playerid, "pDynamicBBArea", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
        SetPVarInt(playerid, "pDynamicBBInt", GetPlayerInterior(playerid));
        SetPVarInt(playerid, "pDynamicBBVW", GetPlayerVirtualWorld(playerid));
	}
//ERROR HERE	return 1;
}
Reply


Messages In This Thread
CMD errors - by San1 - 10.11.2012, 17:35
Re: CMD errors - by Plovix - 10.11.2012, 17:50
Re: CMD errors - by Konstantinos - 10.11.2012, 17:59
Re: CMD errors - by San1 - 10.11.2012, 18:03
Re: CMD errors - by Konstantinos - 10.11.2012, 18:06
Re: CMD errors - by San1 - 10.11.2012, 20:53

Forum Jump:


Users browsing this thread: 1 Guest(s)