23.04.2010, 18:47
So, let me explain, with help of fallout's respawn fs, i tried to edit it and make soemthing for my server.
I want it to start counting whe a player dies, and sets camera in a certain position.
Let's say i made it working, but only for id 0.
Here's my code.
I have this OnPlayerSpawn
And this:
Works only for id 0, what's the problem...
It starts if id is 0, but stops if id is higher..
I want it to start counting whe a player dies, and sets camera in a certain position.
Let's say i made it working, but only for id 0.
Here's my code.
I have this OnPlayerSpawn
pawn Код:
if(PD[playerid] == true)
{
SetPlayerCameraLookAt(playerid, 1999.752197, 1539.617553, 13.585937);
SetPlayerCameraPos(playerid, 1999.752197 + (5 * floatsin(-332.544464, degrees)), 1539.617553 + (5 * floatcos(-332.544464, degrees)), 13.585937);
TextDrawShowForPlayer(playerid, Text:TT[playerid]);
CDT[playerid] = SetTimerEx("CD",100,1, "i", playerid);
}
pawn Код:
public CD(playerid)
{
new pName[MAX_PLAYER_NAME];
new string[256];
if(CT[playerid] >= 0.1)
{
CT[playerid] = floatsub(CT[playerid], 0.1);
new String[128];
format(String, sizeof String, "Respawn in: %.1f", CT[playerid]);
TextDrawSetString(Text:TT[playerid], String);
}
else
{
if(SDM[playerid] == 1)
{
//code
}
if(M4DMM[playerid] == 1)
{
//code
}
if(DDM[playerid] == 1)
{
//code
}
if(TDM[playerid] == 1)
{
//code
}
if(DEDM[playerid] == 1)
{
//code
}
KillTimer(CDT[playerid]);
TextDrawHideForPlayer(playerid, Text:TT[playerid]);
CT[playerid] = 6.0;
SetCameraBehindPlayer(playerid);
}
}
It starts if id is 0, but stops if id is higher..