KillamanLecce

KInclude v1.0

Aug 17th, 2012
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.07 KB | None | 0 0
  1. /*
  2. ______________________________________________________________________________________________________________
  3.                                                KInclude v1.0
  4.                                           Created by Killaman
  5.            
  6. Functions (v1.0):
  7.     SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, Interior, VirtualWorld); - Ex: SetPlayerPosEx(playerid, 3.0, 4.0, 5.0, 0, 0);
  8.     ClearChatForPlayer(playerid, Lines); - Ex: ClearChatForPlayer(playerid, 16);
  9.     ClearChatForAll(Lines); - Ex: ClearChatForAll(30);
  10.     PlayAudioStreamForAll(url[]); - Ex: PlayAudioStreamForAll("http://lololol.com/song.mp3/);
  11.     StopAudioStreamForAll(playerid); - StopAudioStreamForAll(playerid);
  12. ______________________________________________________________________________________________________________
  13. */
  14.  
  15. stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, Interior, VirtualWorld)
  16. {
  17.     if (GetPlayerState(playerid) == 2)
  18.     {
  19.         new
  20.             vehicleid = GetPlayerVehicleID(playerid);
  21.         SetVehiclePos(vehicleid, x, y, z);
  22.         LinkVehicleToInterior(vehicleid, Interior);
  23.         SetVehicleVirtualWorld(vehicleid, VirtualWorld);
  24.     }
  25.     else
  26.     {
  27.         SetPlayerPos(playerid, x, y, z);
  28.         SetPlayerInterior(playerid, Interior);
  29.         SetPlayerVirtualWorld(playerid, VirtualWorld);
  30.     }
  31.     return 1;
  32. }
  33.  
  34. stock ClearChatForPlayer(playerid, Lines)
  35. {
  36.     for(new i = 0; i < Lines; i++) SendClientMessage(playerid, -1, " "); return 1;
  37. }
  38.  
  39. stock ClearChatForAll(Lines)
  40. {
  41.     for(new i = 0; i < Lines; i++) SendClientMessageToAll(-1, " "); return 1;
  42. }
  43.  
  44. stock PlayAudioStreamForAll(url[])
  45. {
  46.     for(new i; i < GetMaxPlayers(); i++)
  47.     {
  48.         if(IsPlayerConnected(i))
  49.         {
  50.             new
  51.                 Float:x, Float:y, Float:z, distance;
  52.             x = 0;
  53.             y = 0;
  54.             z = 0;
  55.             distance = 0;
  56.             PlayAudioStreamForPlayer(i, url, x, y, z, distance);
  57.         }
  58.     }
  59.     return 1;
  60.  
  61. }
  62.  
  63. stock StopAudioStreamForAll()
  64. {
  65.     for(new i; i < GetMaxPlayers(); i++)
  66.     {
  67.         if(IsPlayerConnected(i))
  68.         {
  69.              StopAudioStreamForPlayer(i);
  70.         }
  71.     }
  72.     return 1;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment