help in spec - 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)
+--- Thread: help in spec (
/showthread.php?tid=518826)
help in spec -
Champ - 11.06.2014
ok, i can create it.
pawn Код:
PlayerSpectatePlayer(playerid, targetid);
but how to make it like when player click in spec mode. it can spec all the online players one by one. Any idea?
Need help.
Re: help in spec -
doreto - 11.06.2014
You can use GetPlayerKeys or OnPlayerKeyStateChange to check if admin left click with mouse to forward to next player id.
Re: help in spec -
Champ - 11.06.2014
I know about keystate change. can you give me an example to go through the available ids ? and spec then one by one or randomly.
Re: help in spec -
xGamerFx - 11.06.2014
pawn Код:
CMD:randomspec(playerid,params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerSpectatePlayer(playerid, random(i));
}
}
return 1;
}
try this

if not working tell me
Re: help in spec -
Champ - 11.06.2014
i need a player to test it. So i will test it later. Thank bro.
Re: help in spec -
xGamerFx - 11.06.2014
pawn Код:
CMD:randomspec(playerid,params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, random(i));
}
}
return 1;
}
sorry i forgot this
Re: help in spec -
Champ - 11.06.2014
fine, its working but can you fix this bug. I created it like it send message to the player id that he is spectating %d.
bug:
Код:
[22:49:23] You are spectating 1671753445
[22:49:23] You are spectating 0
[22:49:24] You are spectating 582277378
[22:49:24] You are spectating 0
[22:49:25] You are spectating 1706884788
[22:49:25] You are spectating 0
[22:49:26] You are spectating 1703948818
[22:49:26] You are spectating 0
[22:49:26] You are spectating 1797934518
[22:49:26] You are spectating 0
[22:49:27] You are spectating 890837544
[22:49:27] You are spectating 0
[22:49:29] You are spectating 68896010
code:
pawn Код:
if (PRESSED( KEY_FIRE ))
{
if(isDead[playerid] == 1)
{
new stringn[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerSpectatePlayer(playerid, random(i));
format(stringn, sizeof(stringn),"You are spectating %d", random(i));
SendClientMessage(playerid, -1, stringn);
}
}
}
return 1;
}
Re: help in spec -
xGamerFx - 11.06.2014
pawn Код:
if (PRESSED( KEY_FIRE ))
{
if(isDead[playerid] == 1)
{
new stringn[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
TogglePlayerSpectating(playerid, 1);
new name[MAX_PLAYER_NAME];
GetPlayerName(random(i), name, sizeof(name));
PlayerSpectatePlayer(playerid, random(i));
format(stringn, sizeof(stringn),"You are spectating %s", random(i));
SendClientMessage(playerid, -1, stringn);
new name1[MAX_PLAYER_NAME];
new stringxD[300];
GetPlayerName(playerid, name1, sizeof(name1));
format(stringxD, sizeof(stringxD),"%s is spectating you", name1);
SendClientMessage(random(i),-1,stringxD);
}
}
}
return 1;
}
btw, thanks
Re: help in spec -
Champ - 11.06.2014
ok i will check it.
Already repped you
Re: help in spec -
VenomMancer - 11.06.2014
Maybe This will help you
CLICK HERE