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
#2

Same, but mine is label will be attached to other vehicles or even other scripted labels and disappear when a player connect
Reply
#3

Because you are probably not attaching it to the vehicleid the players in..
Reply
#4

No, I've re-made the D-RP's callsign script. it works fine now, the bug was from streamer.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)