Vehicle spectate problem
#1

command for spectate:

Код:
CMD:recon(playerid, params[])
{
	new id, string[128];
	if(PlayerInfo[playerid][pAdmin] < 2)return SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni");
 	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "/recon [playerid]");
  	else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Pogresan ID");
   	TogglePlayerSpectating(playerid, 1);
   	PlayerSpectatePlayer(playerid, id);
   	SetPlayerInterior(playerid, GetPlayerInterior(id));
   	if(IsPlayerInAnyVehicle(playerid))
   	{
   		new specvehicleid;
		if(specvehicleid < MAX_VEHICLES)
   		TogglePlayerSpectating(playerid, 1);
   		PlayerSpectateVehicle(playerid, specvehicleid);
   	}
   	format(string, sizeof(string), "Sada reconas %s, da ga prestanes reconat koristi: /uncon", PlayerName(id));
   	SendClientMessage(playerid, Grey, string);
    return 1;
}
how it look: http://i.imgur.com/oTQy8.png
Reply
#2

Try :
pawn Код:
CMD:recon(playerid, params[])
{
    new id;
    if(PlayerInfo[playerid][pAdmin] < 2)return SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni");
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "/recon [playerid]");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Pogresan ID");

    TogglePlayerSpectating(playerid, 1);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    if(IsPlayerInAnyVehicle(playerid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
    else PlayerSpectatePlayer(playerid, id);
    new string[128];
    format(string, sizeof(string), "Sada reconas %s, da ga prestanes reconat koristi: /uncon", PlayerName(id));
    SendClientMessage(playerid, Grey, string);
    return 1;
}
Reply
#3

it didnt work :/ still same problem
Reply
#4

Both of those commands check if the player using the command is in a vehicle, not the player you are trying to spectate.
Reply
#5

Quote:
Originally Posted by zDevon
Посмотреть сообщение
Both of those commands check if the player using the command is in a vehicle, not the player you are trying to spectate.
i didnt understand you ... how to make that i cant spectate player in vehicle with normal camera
Reply
#6

use this
pawn Код:
CMD:recon(playerid, params[])
{
    new id, string[128];
    if(PlayerInfo[playerid][pAdmin] < 2)return SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni");
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "/recon [playerid]");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Pogresan ID");
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, id);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    if(IsPlayerInAnyVehicle(id))
    {
        new specvehicleid;
        if(specvehicleid < MAX_VEHICLES)
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectateVehicle(playerid, specvehicleid);
    }
    format(string, sizeof(string), "Sada reconas %s, da ga prestanes reconat koristi: /uncon", PlayerName(id));
    SendClientMessage(playerid, Grey, string);
    return 1;
}
Reply
#7

No that wouldn't work either :S

pawn Код:
CMD:recon(playerid, params[])
{
    new id, string[128];
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni");
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "/recon [playerid]");
    if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_WHITE, "Pogresan ID");
    TogglePlayerSpectating(playerid, 1);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    if(IsPlayerInAnyVehicle(id))
    {
        new specvehicleid = GetPlayerVehicleID(id);
        PlayerSpectateVehicle(playerid, specvehicleid);
    }
    else
    {
        PlayerSpectatePlayer(playerid, id);
    }
    format(string, sizeof(string), "Sada reconas %s, da ga prestanes reconat koristi: /uncon", PlayerName(id));
    SendClientMessage(playerid, Grey, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)