Help with spec
#1

I was woundering if it was possible to have something like a spectating panel, what i mean by panel is when i use /spec it will go into spec, but at the bottom of the screen it will have a box of some sort, with lets say,
'Weapon: weapon' 'Ammo: amount' 'Health: amount' 'Armour: amount' 'Vehicle: veh name' 'Vehicle health: amount'
If so please can you help me with making this, i will be very greatful if you can. thank you

Spec code:
Код:
ACMD:spec(playerid, params[])
{
	new Float:x, Float:y, Float:z;
	if(SpecStats == 0)
	{
		new id;
    	if(pInfo[playerid][Adminlevel] < 1) return 0;
    	if(sscanf(params,"u", id))
    	if(id == INVALID_PLAYER_ID)return SCM(playerid, red, "Player not connected!");
    	GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
    	Inter[playerid] = GetPlayerInterior(playerid);
    	vWorld[playerid] = GetPlayerVirtualWorld(playerid);
    	TogglePlayerSpectating(playerid, true);
    	if(IsPlayerInAnyVehicle(id))
    	{
        	if(GetPlayerInterior(id) > 0)
        	{
            	SetPlayerInterior(playerid,GetPlayerInterior(id));
        	}
        	if(GetPlayerVirtualWorld(id) > 0)
        	{
            	SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
        	}
       		PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
   		}
    	else
    	{
        	if(GetPlayerInterior(id) > 0)
        	{
           		SetPlayerInterior(playerid,GetPlayerInterior(id));
        	}
        	if(GetPlayerVirtualWorld(id) > 0)
        	{
           		SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
        	}
        	PlayerSpectatePlayer(playerid,id);
    	}
    	GetPlayerName(id, Name, sizeof(Name));
    	GetPlayerPos(playerid, Float:x,Float:y,Float:z);
    	format(String, sizeof(String),"You are spectating %s.",Name);
   		SCM(playerid, red,String);
    	IsSpecing[playerid] = 1;
    	IsBeingSpeced[id] = 1;
    	spectatorid[playerid] = id;
    	SpecStats = 1;
	}
	return 1;
}

ACMD:specoff(playerid, params[])
{
    if (pInfo[playerid][Adminlevel] < 1) return 0;
    if(IsSpecing[playerid] == 0)return SCM(playerid,red,"You are not spectating anyone.");
    TogglePlayerSpectating(playerid, 0);
    SpecStats = 0;
    return 1;
}
Once again thanks if you can help me with this, I will also add you in the credits for my server
Reply
#2

Is there anyone who knows and could help me with this please
Reply
#3

Yes it is possible and you can use it by Create Text Draws...
https://sampwiki.blast.hk/wiki/TextDrawCreate
Reply
#4

Ah, nevermind, my brother has made me one, thanks for leading me to the wiki anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)