[HELP] Spectate command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Spectate command (
/showthread.php?tid=276039)
[HELP] Spectate command -
V4at - 12.08.2011
Hello, I use the spectate command and for me it sometimes works sometimes not. Sometimes it shows a good player, but sometimes you need to click on a long time and finally working again. Where is problem?
Here spectate command:
Код:
COMMAND:stebeti(playerid,params[])
{
new zid;
if(sscanf(params, "u", zid)) return SendClientMessage(playerid, 0xFF0000AA, "{FBDF89}[FunZoneLT]>> /stebeti [zaidejoid]");
if(IsPlayerConnected(zid))
{
if(ALygis[playerid] >= 1)
{
if(IsPlayerInAnyVehicle(zid)){
PlayerSpectatePlayer(playerid, 1);
PlayerSpectateVehicle(playerid,GetPlayerVehicleID(zid), SPECTATE_MODE_NORMAL);
} else {
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, zid, SPECTATE_MODE_NORMAL);
}
SendClientMessage(playerid, orandzine, "{FBDF89}[FunZoneLT]>> Jus dabar stebite, kad baigtumete stebeti rasykite /nestebeti");
} else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
} else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
return 1;
}
Код:
COMMAND:nestebeti(playerid,params[])
{
#pragma unused params
TogglePlayerSpectating(playerid, 0);
return 1;
}
Re: [HELP] Spectate command -
Tee - 12.08.2011
pawn Код:
COMMAND:stebeti(playerid,params[])
{
new zid;
if(sscanf(params, "u", zid)) return SendClientMessage(playerid, 0xFF0000AA, "{FBDF89}[FunZoneLT]>> /stebeti [zaidejoid]");
if(IsPlayerConnected(zid))
{
if(ALygis[playerid] >= 1)
{
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(zid))
{
PlayerSpectateVehicle(playerid,GetPlayerVehicleID(zid), SPECTATE_MODE_NORMAL);
}
else
{
PlayerSpectatePlayer(playerid, zid, SPECTATE_MODE_NORMAL);
}
SendClientMessage(playerid, orandzine, "{FBDF89}[FunZoneLT]>> Jus dabar stebite, kad baigtumete stebeti rasykite /nestebeti");
}
else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
}
else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
return 1;
}
You need to use TogglePlayerSpectating(playerid, 1); before you start the spectating.
Re : [HELP] Spectate command -
V4at - 12.08.2011
Thanks