spectating player problem :)
#1

hi,
after a players death i want that the victim is able to watch (spectate) his killer for a few secs before respawning.
Thats not that hard, ive got the needed timers and functions but the spectating is working for me only!
Only my victim can specate (watch) me after ive killed him.
The other players have the pleasure to watch an area part of los santos.

Wheres the error?

pawn Код:
forward Spectateafterdeathend(playerid);
forward Spectatelagtimer(playerid,killerid);

public Spectateafterdeathend(playerid)
{
    TogglePlayerSpectating(playerid,0);
    KillTimer(CRESDisable);
    countdownrespawn = 6;
    TextDrawHideForPlayer(playerid,MiniCountdownrespawn);//this is the texdraw countdown, showing the killed player how long he has to wait for the spawn

   
    return 1;
}

public counterrespawning(playerid,killerid)
{

if(countdownrespawn > 0)
{
CRESDisable = SetTimer("counterrespawning",990,false);
new textformat[85];
format(textformat,sizeof textformat,"~r~%d",countdownrespawn);
TextDrawSetString(MiniCountdownrespawn,textformat);
TextDrawShowForPlayer(playerid,MiniCountdownrespawn);

countdownrespawn --;
}

return 1;
}

public Spectatelagtimer(playerid,killerid)
{

    TogglePlayerSpectating(playerid,1);
    PlayerSpectatePlayer(playerid,killerid,SPECTATE_MODE_NORMAL);
    SetTimerEx("Spectateafterdeathend", 6000,0,"i",playerid);//the textdrawcountdown counts from 6 down to 0

    counterrespawning(playerid,killerid);
   
return 1;
}

//OnPlayerDeath
 SetTimerEx("Spectatelagtimer",3300,0,"i",playerid); //it takes 3,3 secs after death to enter the spectating mode

regards...
Reply
#2

You post questions for everything! Why don't you just take chance and do trial and error! Find out what works and just experiment. You can't come to us for every error you have, then you don't learn anything at all. Don't let this offend you but seriously...
Reply
#3

You forgot the killerid parameter in your timer....
change
pawn Код:
SetTimerEx("Spectatelagtimer",3300,0,"i",playerid); //it takes 3,3 secs after death to enter the spectating mode
to
pawn Код:
SetTimerEx("Spectatelagtimer", 3300, 0, "ii", playerid, killerid); // it takes 3,3 secs after death to enter the spectating mode
Reply
#4

@Garsino: thx for ur answer! Helped me alot.

@Hal: thx for the advice, but believe me, im trying things out but im kinda new to this and im learning alot from ur answers! Its wrong to say u cant learn anything from asking
And i also think that this question is smarter than just a "How to place this map objects in my server, how to spawn a vehicle" question that is posted about 5 times a day here.
In addition, if this is so easy for u, pls post the answer to help me (im sure, if u knew that it would take about 30secs) and dont post if u dont wanna help me.
thx.

regards.
Reply
#5

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
@Hal: thx for the advice, but believe me, im trying things out but im kinda new to this and im learning alot from ur answers! Its wrong to say u cant learn anything from asking
And i also think that this question is smarter than just a "How to place this map objects in my server, how to spawn a vehicle" question that is posted about 5 times a day here.
In addition, if this is so easy for u, pls post the answer to help me (im sure, if u knew that it would take about 30secs) and dont post if u dont wanna help me.
thx.

regards.
But wouldn't it be easier to go out on a limb and just try to use trial and error to figure it out? And you know what I did when I wasn't sure of things when i was still learning the basics of scripting? I downloaded a GM and saw how they made it, I didn't copy it, but most systems are made similar so i could usually see what differs. So if i had an error with dini, i would DL a script that uses dini, and i would see how they used dini to read a file then i would understand that and use that to fix my error/problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)