Textdraw problem, works only on ID 0...
#1

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..
Reply
#2

for loop:
Reply
#3

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...
Reply
#4

Yeah that:P
Reply
#5

Quote:
Originally Posted by whitedragon
Yeah that:P
But won't that make it work for everyone in server?...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)