how do i change spectate to spec i try to scrip it my self but it did not go so well here is the code
----------------------------------------------------------------------------------------------
Code:
dcmd_spectate(playerid,params[])
{
new string[128];
new ID;
if(sscanf(params,"u",ID))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /spectate (Player Name/ID)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot spectate them.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(playerid == ID)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot spectate yourself, how could that even be possible?");
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not spawned. You cannot place spectate dead people ..",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsPlayerInAnyVehicle(ID))
{
new vehid = GetPlayerVehicleID(ID);
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, vehid);
SetPlayerInterior(playerid,GetPlayerInterior(ID));
SpectatingPlayer[playerid] =ID;
IsBeingSpectated[ID] =1;
return 1;
}
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, ID);
SetPlayerInterior(playerid,GetPlayerInterior(ID));
SpectatingPlayer[playerid] =ID;
IsBeingSpectated[ID] =1;
return 1;
}
-----------------------------------------------------------------------------------------------------------
and code again
Code:
dcmd_specoff(playerid,params[])
{
#pragma unused params
if(SpectatingPlayer[playerid] == -1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are not spectating a player. How can you spectating them?");
return 1;
}
TogglePlayerSpectating(playerid,0);
IsBeingSpectated[SpectatingPlayer[playerid]] =0;
SpectatingPlayer[playerid] =-1;
return 1;
}
--------------------------------------------------------------------------------------------------------------
ty guys all the best to you and to yours