Attach3DTextLabel Issue
#1

Код:
COMMAND:carsign(playerid, params[])
{
    if(GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
	if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "You must be the driver in a vehicle to use this!");
    if(VehicleInfo[GetPlayerVehicleID(playerid)][vType] != VEHICLE_LSPD) return SendClientMessage(playerid, COLOR_WHITE, "You need to be in a police vehicle to use this.");
    if(GetPVarInt(playerid, "Delay") > GetCount()) return SendClientMessage(playerid, COLOR_LIGHTRED, "You must wait before performing this command!");
	new txt[50];
	if(sscanf(params, "s[50]", txt)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /carsign [text]");
	else
	{
	    if((GetPVarInt(playerid, "Member") == 1 && GetPVarInt(playerid, "Rank") >= 2) || GetPVarInt(playerid, "Member") == 2)
	    {
	        SetPVarInt(playerid, "Delay", GetCount()+2000);
	        new getcar = GetPlayerVehicleID(playerid);
			if(VehicleInfo[getcar][vUText] == 0) {
                VehicleInfo[getcar][vUText]=1;
                VehicleInfo[getcar][vCText] = Create3DTextLabel(txt, -1, 0.0, 0.0, 0.0, 50.0, 0, 1);
                Attach3DTextLabelToVehicle(VehicleInfo[getcar][vCText], getcar, -0.8, -2.8, -0.3);
                scm(playerid, -1, "Car sign added!");
            } else {
            VehicleInfo[getcar][vUText]=0;
            Delete3DTextLabel(VehicleInfo[getcar][vCText]);
			scm(playerid, -1, "Car sign removed!"); }
	    }
	    else SendClientMessage(playerid, COLOR_LIGHTRED, "You do not have access to this command!");
	}
	return 1;
}
I've attempted to debug it and I have read the code multiple times and it seems like nothing wrong, basicly the label go's about 1 minute attached to the vehicle.
Reply


Messages In This Thread
Attach3DTextLabel Issue - by alexanderjb918 - 02.07.2016, 11:19
Re: Attach3DTextLabel Issue - by SetPlayerNameTag - 02.07.2016, 11:28
Re: Attach3DTextLabel Issue - by alexanderjb918 - 02.07.2016, 11:29
Re: Attach3DTextLabel Issue - by SetPlayerNameTag - 02.07.2016, 11:43

Forum Jump:


Users browsing this thread: 1 Guest(s)