11.11.2014, 18:31
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:
Once again thanks if you can help me with this, I will also add you in the credits for my server
'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;
}

