help with onplayerspawn
#1

now i made when cops spawn there is nice police training textdraw for them so now i want to make timer to close this text draw and i dont know how to make it ^^ here is my code

Код:
public OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_SHERIFF || gTeam[playerid] == TEAM_COP)
  {
  TextDrawShowForPlayer(playerid,Text:Textdraw0);
  TextDrawShowForPlayer(playerid,Text:Textdraw1);
  TextDrawShowForPlayer(playerid,Text:Textdraw2);
  TextDrawShowForPlayer(playerid,Text:Textdraw3);
  TextDrawShowForPlayer(playerid,Text:Textdraw4);
  TextDrawShowForPlayer(playerid,Text:Textdraw5);
  TextDrawShowForPlayer(playerid,Text:Textdraw6);
  TextDrawShowForPlayer(playerid,Text:Textdraw7);
  TextDrawShowForPlayer(playerid,Text:Textdraw8);
  TextDrawShowForPlayer(playerid,Text:Textdraw9);
  TextDrawShowForPlayer(playerid,Text:Textdraw10);
  TextDrawShowForPlayer(playerid,Text:Textdraw11);
  TextDrawShowForPlayer(playerid,Text:Textdraw12);
  
  SetPlayerInterior(playerid,0);
  SetPlayerCameraPos(playerid,2290.5300,2400.1262,18.4163);
  SetPlayerCameraLookAt(playerid, 2290.1648,2429.6484,10.8203);
  }
  return 1;
}
if i have this, the textdraws are showed all game :P now i need timer about 10 sec and then text draws close and camera is not ''looking in LV PD'' here is my full code and you can test how it is looking atm:

http://pastebin.com/m49b7dc9f

hope someone will have time and test it and make the timer to close text draws and camera ... ty
Reply
#2

http://forum.sa-mp.com/index.php?act...page=searching
Reply
#3

Quote:
Originally Posted by Memoryz
its easy to link this but i think its hard to help ... for what should i search?
Reply
#4

any other help ?
Reply
#5

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx

https://sampwiki.blast.hk/wiki/TextDrawHideForAll
https://sampwiki.blast.hk/wiki/TextDrawHideForPlayer
Reply
#6

Код:
public OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_SHERIFF || gTeam[playerid] == TEAM_COP)
  {
  TextDrawShowForPlayer(playerid,Text:Textdraw0);
  TextDrawShowForPlayer(playerid,Text:Textdraw1);
  TextDrawShowForPlayer(playerid,Text:Textdraw2);
  TextDrawShowForPlayer(playerid,Text:Textdraw3);
  TextDrawShowForPlayer(playerid,Text:Textdraw4);
  TextDrawShowForPlayer(playerid,Text:Textdraw5);
  TextDrawShowForPlayer(playerid,Text:Textdraw6);
  TextDrawShowForPlayer(playerid,Text:Textdraw7);
  TextDrawShowForPlayer(playerid,Text:Textdraw8);
  TextDrawShowForPlayer(playerid,Text:Textdraw9);
  TextDrawShowForPlayer(playerid,Text:Textdraw10);
  TextDrawShowForPlayer(playerid,Text:Textdraw11);
  TextDrawShowForPlayer(playerid,Text:Textdraw12);
  
  SetPlayerInterior(playerid,0);
  SetPlayerCameraPos(playerid,2290.5300,2400.1262,18.4163);
  SetPlayerCameraLookAt(playerid, 2290.1648,2429.6484,10.8203);

  SetTimerEx("HideTextDraw",30000,0,"i",playerid); // (30 secs in milliseconds, change it to something else or whatever)
  }
  return 1;
}
Код:
forward HideTextDraw(playerid)
Код:
public HideTextDraw(playerid)
{
  TextDrawHideForPlayer(playerid,Textdraw0);
  TextDrawHideForPlayer(playerid,Textdraw1);
  TextDrawHideForPlayer(playerid,Textdraw2);
  TextDrawHideForPlayer(playerid,Textdraw3);
  TextDrawHideForPlayer(playerid,Textdraw4);
  TextDrawHideForPlayer(playerid,Textdraw5);
  TextDrawHideForPlayer(playerid,Textdraw6);
  TextDrawHideForPlayer(playerid,Textdraw7);
  TextDrawHideForPlayer(playerid,Textdraw8);
  TextDrawHideForPlayer(playerid,Textdraw9);
  TextDrawHideForPlayer(playerid,Textdraw10);
  TextDrawHideForPlayer(playerid,Textdraw11);
  TextDrawHideForPlayer(playerid,Textdraw12);
  return 1;
}
Reply
#7

ty but how i can get camera back at normal wiev ? first person or what ever it is ?
Reply
#8

Quote:
Originally Posted by Lajko1
ty but how i can get camera back at normal wiev ? first person or what ever it is ?
pawn Код:
SetCameraBehindPlayer(playerid);
Reply
#9

thank you it worsk <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)