Textdraw problem, works only on ID 0... - 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: Textdraw problem, works only on ID 0... (
/showthread.php?tid=143622)
Textdraw problem, works only on ID 0... -
Zh3r0 - 23.04.2010
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
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);
}
And this:
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);
}
}
Works only for id 0, what's the problem...
It starts if id is 0, but stops if id is higher..
Re: Textdraw problem, works only on ID 0... -
whitedragon - 23.04.2010
for loop:
Re: Textdraw problem, works only on ID 0... -
Zh3r0 - 23.04.2010
Quote:
Originally Posted by whitedragon
for loop:
|
Hmmm? You say i should use a loop?
pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
////
}
}
You mean this?
Dun post shits...
Re: Textdraw problem, works only on ID 0... -
whitedragon - 23.04.2010
Yeah that:P
Re: Textdraw problem, works only on ID 0... -
Zh3r0 - 24.04.2010
Quote:
Originally Posted by whitedragon
Yeah that:P
|
But won't that make it work for everyone in server?...