Help with spectation
#5

try this

PHP код:
new FloatPlayerPosX[MAX_PLAYERS], FloatPlayerPosY[MAX_PLAYERS], Float:PlayerPosZ[MAX_PLAYERS];//AT top
CMD:spec(playerid,params[])
{
    new 
Float:xFloat:yFloat:z;
    if(
GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) return StopSpec(playerid);
    new 
id;
    if(
sscanf(params"u"id)) return SendError(playerid,"Use: /spec [ID]");
    new 
mess[80 MAX_PLAYER_NAME];
    
GetPlayerPos(playeridxyz);
    
SpectatingIS(playerid);
    
PlayerPosX[playerid] = x;
    
PlayerPosY[playerid] = y;
    
PlayerPosZ[playerid] = z;
    
SetPlayerVirtualWorld(playeridGetPlayerVirtualWorld(id));
    
SetPlayerInterior(playeridGetPlayerInterior(id));
    
TogglePlayerSpectating(playeridtrue);
    if(
IsPlayerInAnyVehicle(id)) PlayerSpectateVehicle(playeridGetPlayerVehicleID(id));
    else 
PlayerSpectatePlayer(playeridid);
    return 
1;
}
stock StopSpec(playerid)
{
    
statec[playerid] = true;
    
SetPlayerPos(playeridPlayerPosX[playerid], PlayerPosY[playerid], PlayerPosZ[playerid]);
    
SetPlayerVirtualWorld(playeridpInfo[playerid][world]);
    
SetPlayerInterior(playerid,pInfo[playerid][interior]);
    
TogglePlayerSpectating(playerid,false);
    if(
pInfo[playerid][ant] == falseTogglePlayerControllable(playerid,true);
    for(new 
slot=0slot 13slot++) GivePlayerWeaponEx(playerid,weaps[playerid][slot], amunition[playerid][slot]);
    return 
1;

Reply


Messages In This Thread
Help with spectation - by ,TomY' - 26.07.2017, 13:35
Re: Help with spectation - by aoky - 26.07.2017, 13:44
Re: Help with spectation - by ,TomY' - 26.07.2017, 13:54
Re: Help with spectation - by zsoolt997 - 26.07.2017, 14:19
Re: Help with spectation - by IceBilizard - 26.07.2017, 14:46

Forum Jump:


Users browsing this thread: 1 Guest(s)