Boombox help again please
#1

Well the problem is i made it where players can only set 1 boombox
But it still keeps placing down boomboxes

the whole place cmd is here:
Код:
CMD:placeboombox(playerid, params[])
{
    if (PlayerInfo[playerid][pAlreadyBoombox] == 1)
    {
		SendClientMessage(playerid, COLOR_YELLOW, "You have already placed a boombox somewhere go /pickupboombox near it.");
		return 1;
	}
    if (PlayerInfo[playerid][pbuyBoombox] == 0)
    {
		SendClientMessage(playerid, COLOR_YELLOW, "You dont have a boombox - buy one from your local 24/7.");
		return 1;
	}
	else
	{
	    if (PlayerInfo[playerid][pbuyBoombox] == 1)
	    SendClientMessageEx(playerid, COLOR_YELLOW, "You have placed Boombox on the ground, /pickupboombox to remove it.");
	}
        GetPlayerPos(playerid,Positions[0][0], Positions[0][1], Positions[0][2]);
        SetPVarFloat(playerid, "DYN_Boombox_FLOAT_X", Positions[0][0]);
        SetPVarFloat(playerid, "DYN_Boombox_FLOAT_Y", Positions[0][1]);
        SetPVarFloat(playerid, "DYN_Boombox_FLOAT_Z", Positions[0][2]);
        PlayerInfo[playerid][pBoombox] = CreateDynamicObject(2103, Positions[0][0], Positions[0][1], Positions[0][2]-0.9, 0, 0, 3.9700012207031);
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
        SendClientMessageEx(playerid, COLOR_YELLOW, "you set the station use /turnonboombox - turn off using /turnoffboombox.");
    	return 1;
}
i have everything else working but that one problem is the first If thats called pAlreadyBoombox and if equals 1 u cannot set another if equals 0 u can set one but idk please help
Reply
#2

Try this:

pawn Код:
CMD:placeboombox(playerid, params[])
{
    if (PlayerInfo[playerid][pAlreadyBoombox] == 1)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You have already placed a boombox somewhere go /pickupboombox near it.");
        return 1;
    }
    if (PlayerInfo[playerid][pbuyBoombox] == 0)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You dont have a boombox - buy one from your local 24/7.");
        return 1;
    }
    else
    {
        if (PlayerInfo[playerid][pbuyBoombox] == 1)
        SendClientMessageEx(playerid, COLOR_YELLOW, "You have placed Boombox on the ground, /pickupboombox to remove it.");
    }
    GetPlayerPos(playerid,Positions[0][0], Positions[0][1], Positions[0][2]);
    SetPVarFloat(playerid, "DYN_Boombox_FLOAT_X", Positions[0][0]);
    SetPVarFloat(playerid, "DYN_Boombox_FLOAT_Y", Positions[0][1]);
    SetPVarFloat(playerid, "DYN_Boombox_FLOAT_Z", Positions[0][2]);
    PlayerInfo[playerid][pBoombox] = CreateDynamicObject(2103, Positions[0][0], Positions[0][1], Positions[0][2]-0.9, 0, 0, 3.9700012207031);
    ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
    ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
    SendClientMessageEx(playerid, COLOR_YELLOW, "you set the station use /turnonboombox - turn off using /turnoffboombox.");
    PlayerInfo[playerid][pAlreadyBoombox] = 1;
    return 1;
}
You never set pAlreadyBoombox to 1.
Reply
#3

Thanks so much bro but i found out the problem already was gonna reply about it but u deserve +rep for an good reply
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)