Advertisement
Kwarde

Smoke System

Oct 24th, 2010
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.79 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new bool:SmokeIsOn[MAX_PLAYERS] = false;
  4. new SmokeObject[MAX_PLAYERS];
  5.  
  6. public OnFilterScriptInit()
  7. {
  8.     return 1;
  9. }
  10.  
  11. public OnFilterScriptExit()
  12. {
  13.     for(new i = 0; i < MAX_PLAYERS; i++)
  14.     {
  15.         if(IsPlayerConnected(i) && SmokeIsOn[i]){
  16.             StopPlayerHoldingObject(i);
  17.         }
  18.     }
  19.     return 1;
  20. }
  21.  
  22. public OnPlayerCommandText(playerid, cmdtext[])
  23. {
  24.     if(!strcmp(cmdtext, "/smoke", true))
  25.     {
  26.         new Float:pX, Float:pY, Float:pZ;
  27.         if(!SmokeIsOn[playerid]){
  28.             SmokeIsOn[playerid] = true;
  29.             GetPlayerPos(playerid, pX, pY, pZ);
  30.             SmokeObject[playerid] = SetPlayerHoldingObject(playerid, 2780, 10);
  31.         }
  32.         else{
  33.             SmokeIsOn[playerid] = false;
  34.             StopPlayerHoldingObject(playerid);
  35.             SmokeObject[playerid] = (-1);
  36.         }
  37.     }
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement