15.06.2011, 16:32
Hey i want to make that , when i finish (race) , then i go specing , and i can use Space to spec next and so else i make ( my friend ) smthing , but its not working . Can you say, where is my fail and can you fix it ?
pawn Код:
SetPVarInt(playerid,"Spectator",1);
TogglePlayerSpectating(playerid, 1);
TextDrawShowForPlayer(playerid, SpecInfo);
TextDrawShowForPlayer(playerid, SpaceInfo);
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
specing[playerid] = i;
PlayerSpectatePlayer(playerid, i);
spectatting[playerid] = 1;
return 1;
}
if(i == MAX_PLAYERS) i=0;
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SPRINT)
{
if(spectatting[playerid] == 1)
{
for(new i;specing[playerid]<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
specing[playerid] = i;
PlayerSpectatePlayer(playerid, i);
spectatting[playerid] = 1;
return 1;
}
if(i == MAX_PLAYERS) i=0;
}
return 1;
}
return 1;
}
return 1;
}