Advertisement
Guest User

Actor System

a guest
Feb 13th, 2018
1,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.96 KB | None | 0 0
  1. /*
  2. ||| ACTOR system made by Pizza. |||
  3. Commands are:
  4. /spawnactor [skin id] [Vulnerability (0: invulnerable / 1: vulnerable)] > spawns the actor where the player is facing
  5. /removeactor [actor id] (id can be viewed if went near him or /allactors) > removes specified actor
  6. /removeallactors > clears all actors
  7. /gotoactor [actor id] > TP you to the actor's POS (position)
  8. /setactoranim [animation name] > Set an anim on actor
  9. /cancelactoranim [actor id] > cancels the anim that has been excuted on the actor
  10. /actorstext > shows/hides all actors text
  11. /updateactor [actor id] [skin id] [vulnerability] > updates specified actor's skin and vulnerability (Also updates rotation, view where you want and apply command!)
  12.  
  13. NOTE: Make sure you are logged in as RCON admin else it will return 0 (unknown command)
  14. */
  15.  
  16. #include <a_samp>
  17. #include <zcmd>
  18. #include <sscanf2>
  19. #include <a_actor>
  20.  
  21. ///////////////////////////////////////////////////
  22. public OnFilterScriptInit()
  23. {
  24.     print("\n____________________________________________________");
  25.     print("___________Actor system by Pizza__________");
  26.     print("____________________________________________________\n");
  27.     return 1;
  28. }
  29.  
  30. ///////////////////////////////////////////////////
  31. //COLORS
  32. #define COLOR_GREEN 0x33AA33AA
  33. #define COLOR_RED 0xFF0000AA
  34. #define COLOR_PURPLE 0x800080FF
  35. #define COLOR_YELLOW 0xFFFF00AA
  36. #define COLOR_GREEN 0x33AA33AA
  37. ///////////////////////////////////////////////////
  38. #define FILTERSCRIPT
  39. #define DIALOG_ACTORHELP 666
  40. #define MAX_LABELS 1000
  41. ///////////////////////////////////////////////////
  42. /*
  43. If your actor's vulnrability is off(0), when you shoot him in the knees or his health is <= 30 he will do animation "injured"
  44. and when you shoot him in the head or his health is 0 he will do death animation.
  45. */
  46. enum ActorSt
  47. {
  48.     Dead,
  49.     Injured
  50. }
  51. new ActorState[MAX_ACTORS][ActorSt];
  52. public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
  53. {
  54.     new Float:ahealth;
  55.     GetActorHealth(damaged_actorid,ahealth);
  56.     SetActorHealth(damaged_actorid,ahealth-amount);
  57.     if(ActorState[damaged_actorid][Injured] == 0)
  58.     {
  59.         if(ahealth <= 30 && ahealth > 0 || bodypart == 7 || bodypart == 8)
  60.         {
  61.             ApplyActorAnimation(damaged_actorid, "SWEET", "Sweet_injuredloop", 4.1, 1, 0, 0, 0, 0);
  62.             ApplyActorAnimation(damaged_actorid, "SWEET", "Sweet_injuredloop", 4.1, 1, 0, 0, 0, 0);
  63.             ActorState[damaged_actorid][Injured] = 1;
  64.             if(ahealth == 0) return ClearActorAnimations(damaged_actorid);
  65.         }
  66.     }
  67.     if(ActorState[damaged_actorid][Dead] == 0)
  68.     {
  69.         if(bodypart == 9 || ahealth <= 0)
  70.         {
  71.             SetActorHealth(damaged_actorid,0);
  72.             ApplyActorAnimation(damaged_actorid,"KNIFE","KILL_Knife_Ped_Die",4.1, 0, 0, 0, 1, 0);
  73.             ActorState[damaged_actorid][Dead] = 1;
  74.         }
  75.     }
  76.     return 1;
  77. }
  78. ///////////////////////////////////////////////////
  79. enum _labels
  80. {
  81.     Text3D: label_ID,
  82.     label_text[128],
  83.     Float: label_pos[3]
  84. }
  85. new
  86.     aLabels[MAX_LABELS][_labels];
  87.  
  88. stock ClearLabel(labelid)
  89. {
  90.     if(labelid == INVALID_3DTEXT_ID)
  91.         return 0;
  92.  
  93.     Delete3DTextLabel(aLabels[labelid][label_ID]);
  94.  
  95.     aLabels[labelid][label_ID] = Text3D: INVALID_3DTEXT_ID;
  96.  
  97.     aLabels[labelid][label_pos][0] = 0.0;
  98.     aLabels[labelid][label_pos][1] = 0.0;
  99.     aLabels[labelid][label_pos][2] = 0.0;
  100.  
  101.     aLabels[labelid][label_text][0] = EOS;
  102.     return 1;
  103. }
  104.  
  105. new ActorText[MAX_ACTORS];
  106. /////////////////////////////////////////////////////////////
  107. //                        COMMANDS
  108. /////////////////////////////////////////////////////////////
  109. CMD:spawnactor(playerid, params[])
  110. {
  111.     if(IsPlayerAdmin(playerid)){
  112.     new Float:Pos[3],skinid,str[256],invulnerability,Float:Angle;
  113.     if(sscanf(params,"il",skinid,invulnerability)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /spawnactor [skinid] [Vulnerability (0: invulnerable / 1: vulnerable)]");
  114.     if(skinid > 311 || skinid < 0) return SendClientMessage(playerid,COLOR_RED,"Invalid skin id!");
  115.     if(invulnerability != 1 && invulnerability != 0) return SendClientMessage(playerid,COLOR_RED,"Vulnerability (0: invulnerable / 1: vulnerable)");
  116.     GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  117.     GetPlayerFacingAngle(playerid, Angle);
  118.     new Actor = CreateActor(skinid, Pos[0], Pos[1], Pos[2], 0);
  119.     SetPlayerPos(playerid,Pos[0]+1,Pos[1]+1,Pos[2]);
  120.     SetActorFacingAngle(Actor, Angle);
  121.     format(str,sizeof(str),"Actor %d was created! Pos: x[%f], y[%f], z[%f]",Actor,Pos[0],Pos[1],Pos[2]);
  122.     SendClientMessage(playerid,COLOR_GREEN,str);
  123.     new str2[256];
  124.     format(str2,sizeof(str2),"Actor ID: %d",Actor);
  125.     aLabels[Actor][label_ID] = Create3DTextLabel(str2, COLOR_YELLOW, Pos[0], Pos[1], Pos[2], 10, 0, 0);
  126.     aLabels[Actor][label_pos][0] = Pos[0];
  127.     aLabels[Actor][label_pos][1] = Pos[1];
  128.     aLabels[Actor][label_pos][2] = Pos[2];
  129.     if(invulnerability == 0)
  130.     {
  131.         SetActorInvulnerable(Actor, 1);
  132.         SendClientMessage(playerid,COLOR_GREEN,"This actor is invulnerable!");
  133.     }
  134.     else if(invulnerability == 1)
  135.     {
  136.         SetActorHealth(Actor, 100);
  137.         SetActorInvulnerable(Actor,0);
  138.         SendClientMessage(playerid,COLOR_GREEN,"This actor is vulnerable!");
  139.     }
  140.     for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  141.     {
  142.         if(ActorText[i] == 1)
  143.         {
  144.             ActorText[Actor] = 1;
  145.         }
  146.         else if(ActorText[i] == 0)
  147.         {
  148.             ActorText[Actor] = 0;
  149.             ClearLabel(Actor);
  150.         }
  151.     }
  152.     ActorState[Actor][Dead] = 0;
  153.     ActorState[Actor][Injured] = 0;
  154.     }
  155.     else return 0;
  156.     return 1;
  157. }
  158. ///////////////////////////////////////////////////
  159. CMD:removeactor(playerid, params[])
  160. {
  161.     if(IsPlayerAdmin(playerid)){
  162.     new actorid,str[256];
  163.     if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /removeactor [actor id]");
  164.     format(str,sizeof(str),"Actor %d was removed!",actorid);
  165.     if(IsValidActor(actorid))
  166.     {
  167.         SendClientMessage(playerid,COLOR_GREEN,str);
  168.         DestroyActor(actorid);
  169.         ClearLabel(actorid);
  170.     }
  171.     else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
  172.     }
  173.     else return 0;
  174.     return 1;
  175. }
  176. ///////////////////////////////////////////////////
  177. CMD:removeallactors(playerid, params[])
  178. {
  179.     if(IsPlayerAdmin(playerid)){
  180.     for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  181.     {
  182.         if(IsValidActor(i))
  183.         {
  184.             DestroyActor(i);
  185.             ClearLabel(i);
  186.         }
  187.     }
  188.     }
  189.     else return 0;
  190.     return 1;
  191. }
  192. ///////////////////////////////////////////////////
  193. CMD:gotoactor(playerid, params[])
  194. {
  195.     if(IsPlayerAdmin(playerid)){
  196.     new Float:Pos[3],actorid,str[256];
  197.     if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /gotoactor [actor id]");
  198.     if(IsValidActor(actorid))
  199.     {
  200.         GetActorPos(actorid,Pos[0],Pos[1],Pos[2]);
  201.         SetPlayerPos(playerid,Pos[0]+1,Pos[1],Pos[2]);
  202.         format(str,sizeof(str),"You have been teleported to actor %d!",actorid);
  203.         SendClientMessage(playerid,COLOR_GREEN,str);
  204.     }
  205.     else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
  206.     }
  207.     else return 0;
  208.     return 1;
  209. }
  210. ///////////////////////////////////////////////////
  211. CMD:allactors(playerid, params[])
  212. {
  213.     if(IsPlayerAdmin(playerid)){
  214.     new str[400];
  215.     SendClientMessage(playerid,COLOR_RED,"_______________________________________________");
  216.     for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  217.     {
  218.         if(IsValidActor(i))
  219.         {
  220.             format(str,sizeof(str),"Actor: %d | vulnerability: %d",i,!IsActorInvulnerable(i));
  221.             SendClientMessage(playerid,COLOR_GREEN,str);
  222.         }
  223.         else
  224.         {
  225.             SendClientMessage(playerid,COLOR_RED,"-");
  226.             continue;
  227.         }
  228.     }
  229.     SendClientMessage(playerid,COLOR_RED,"_______________________________________________");
  230.     }
  231.     else return 0;
  232.     return 1;
  233. }
  234. ///////////////////////////////////////////////////
  235. CMD:setactoranim(playerid, params[])
  236. {
  237.     if(IsPlayerAdmin(playerid)){
  238.     new animation[256],actorid,str[256];
  239.     if(sscanf(params,"is[100]",actorid,animation)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /setactoranim [actor id] [animation]");
  240.     if(IsValidActor(actorid))
  241.     {
  242.         if(!strcmp(animation, "injured"))
  243.         {
  244.             ApplyActorAnimation(actorid, "SWEET", "Sweet_injuredloop", 4.1, 1, 0, 0, 0, 0);
  245.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  246.             SendClientMessage(playerid,COLOR_GREEN,str);
  247.         }
  248.         if(!strcmp(animation, "handsup"))
  249.         {
  250.             ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 1, 0, 0, 0, 0);
  251.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  252.             SendClientMessage(playerid,COLOR_GREEN,str);
  253.         }
  254.         if(!strcmp(animation, "sit"))
  255.         {
  256.             ApplyActorAnimation(actorid, "BEACH", "ParkSit_M_loop", 4.1, 1, 0, 0, 0, 0);
  257.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  258.             SendClientMessage(playerid,COLOR_GREEN,str);
  259.         }
  260.         if(!strcmp(animation, "lean"))
  261.         {
  262.             ApplyActorAnimation(actorid, "GANGS", "leanIDLE", 4.1, 1, 0, 0, 0, 0);
  263.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  264.             SendClientMessage(playerid,COLOR_GREEN,str);
  265.         }
  266.         if(!strcmp(animation, "dance"))
  267.         {
  268.             ApplyActorAnimation(actorid, "DANCING", "dance_loop", 4.1, 1, 0, 0, 0, 0);
  269.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  270.             SendClientMessage(playerid,COLOR_GREEN,str);
  271.         }
  272.         if(!strcmp(animation, "dealstance"))
  273.         {
  274.             ApplyActorAnimation(actorid, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0);
  275.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  276.             SendClientMessage(playerid,COLOR_GREEN,str);
  277.         }
  278.         if(!strcmp(animation, "riotchant"))
  279.         {
  280.             ApplyActorAnimation(actorid, "RIOT", "RIOT_CHANT", 4.1, 1, 0, 0, 0, 0);
  281.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  282.             SendClientMessage(playerid,COLOR_GREEN,str);
  283.         }
  284.         if(!strcmp(animation, "wave"))
  285.         {
  286.             ApplyActorAnimation(actorid, "ON_LOOKERS", "wave_loop", 4.1, 1, 0, 0, 0, 0);
  287.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  288.             SendClientMessage(playerid,COLOR_GREEN,str);
  289.         }
  290.         if(!strcmp(animation, "hide"))
  291.         {
  292.             ApplyActorAnimation(actorid, "ped", "cower", 4.1, 1, 0, 0, 0, 0);
  293.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  294.             SendClientMessage(playerid,COLOR_GREEN,str);
  295.         }
  296.         if(!strcmp(animation, "crossarms"))
  297.         {
  298.             ApplyActorAnimation(actorid, "COP_AMBIENT", "Coplook_loop", 4.1, 1, 0, 0, 0, 0);
  299.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  300.             SendClientMessage(playerid,COLOR_GREEN,str);
  301.         }
  302.         if(!strcmp(animation, "laugh"))
  303.         {
  304.             ApplyActorAnimation(actorid, "RAPPING", "Laugh_01", 4.1, 1, 0, 0, 0, 0);
  305.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  306.             SendClientMessage(playerid,COLOR_GREEN,str);
  307.         }
  308.         if(!strcmp(animation, "talk"))
  309.         {
  310.             ApplyActorAnimation(actorid, "PED", "IDLE_CHAT", 4.1, 1, 0, 0, 0, 0);
  311.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  312.             SendClientMessage(playerid,COLOR_GREEN,str);
  313.         }
  314.         if(!strcmp(animation, "fucku"))
  315.         {
  316.             ApplyActorAnimation(actorid, "PED", "fucku", 4.1, 1, 0, 0, 0, 0);
  317.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  318.             SendClientMessage(playerid,COLOR_GREEN,str);
  319.         }
  320.         if(!strcmp(animation, "tired"))
  321.         {
  322.             ApplyActorAnimation(actorid, "PED", "IDLE_tired", 4.1, 1, 0, 0, 0, 0);
  323.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  324.             SendClientMessage(playerid,COLOR_GREEN,str);
  325.         }
  326.         if(!strcmp(animation, "chairsit"))
  327.         {
  328.             ApplyActorAnimation(actorid, "PED", "SEAT_idle", 4.1, 1, 0, 0, 0, 0);
  329.             format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
  330.             SendClientMessage(playerid,COLOR_GREEN,str);
  331.         }
  332.     }
  333.     else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
  334.     }
  335.     else return 0;
  336.     return 1;
  337. }
  338. ///////////////////////////////////////////////////
  339. CMD:cancelactoranim(playerid, params[])
  340. {
  341.     if(IsPlayerAdmin(playerid)){
  342.     new actorid;
  343.     if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /cancelactoranim [actor id]");
  344.     if(IsValidActor(actorid))
  345.     {
  346.         ClearActorAnimations(actorid);
  347.         SendClientMessage(playerid,COLOR_GREEN,"Animation canceled!");
  348.     }
  349.     else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
  350.     }
  351.     else return 0;
  352.     return 1;
  353. }
  354. ///////////////////////////////////////////////////
  355. CMD:cancelallactorsanim(playerid, params[])
  356. {
  357.     if(IsPlayerAdmin(playerid)){
  358.     for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  359.     {
  360.         ClearActorAnimations(i);
  361.     }
  362.     SendClientMessage(playerid,COLOR_GREEN,"You have canceled all actors' animations!");
  363.     }
  364.     else return 0;
  365.     return 1;
  366. }
  367. ///////////////////////////////////////////////////
  368. CMD:getactor(playerid, params[])
  369. {
  370.     if(IsPlayerAdmin(playerid)){
  371.     new actorid,str[256],Float:pPos[3],Float:aPos[3],Float:newPos[3];
  372.     if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /getactor [actor id]");
  373.     if(IsValidActor(actorid))
  374.     {
  375.         ClearLabel(actorid);
  376.         GetActorPos(actorid,aPos[0],aPos[1],aPos[2]);
  377.         GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
  378.         SetActorPos(actorid,pPos[0],pPos[1],pPos[2]);
  379.         GetActorPos(actorid,newPos[0],newPos[1],newPos[2]);
  380.         SetPlayerPos(playerid,pPos[0]+1,pPos[1]+1,pPos[2]);
  381.         format(str,sizeof(str),"Actor ID: %d",actorid);
  382.         aLabels[actorid][label_ID]  = Create3DTextLabel(str, COLOR_YELLOW, newPos[0], newPos[1], newPos[2], 10, 0, 0);
  383.         for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  384.         {
  385.             if(ActorText[i] == 1)
  386.             {
  387.                 ActorText[actorid] = 1;
  388.             }
  389.             else if(ActorText[i] == 0)
  390.             {
  391.                 ActorText[actorid] = 0;
  392.                 ClearLabel(actorid);
  393.             }
  394.         }
  395.     }
  396.     else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
  397.     }
  398.     else return 0;
  399.     return 1;
  400. }
  401. ///////////////////////////////////////////////////
  402. CMD:actorstext(playerid,params[])
  403. {
  404.     if(IsPlayerAdmin(playerid))
  405.     {
  406.         for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  407.         {
  408.             if(ActorText[i] == 0)
  409.             {
  410.                 ActorText[i] = 1;
  411.                 new Float:Pos[3],str2[256];
  412.                 format(str2,sizeof(str2),"Actor ID: %d",i);
  413.                 GetActorPos(i,Pos[0],Pos[1],Pos[2]);
  414.                 aLabels[i][label_ID] = Create3DTextLabel(str2, COLOR_YELLOW, Pos[0], Pos[1], Pos[2], 10, 0, 0);
  415.             }
  416.             else if(ActorText[i] == 1)
  417.             {
  418.                 ActorText[i] = 0;
  419.                 ClearLabel(i);
  420.             }
  421.         }
  422.     }
  423.     else return 0;
  424.     return 1;
  425. }
  426. ///////////////////////////////////////////////////
  427. CMD:actorhelp(playerid,params[])
  428. {
  429.     if(IsPlayerAdmin(playerid))
  430.     {
  431.         new text[500],text2[500],text3[500],everything[1000];
  432.         format(text,sizeof(text),"{A9A9A9}** {ff0000}/spawnactor [skin id] [Vulnerability (0: invulnerable / 1: vulnerable)] > {8B0000}spawns the actor where the player is facing\n{A9A9A9}** {ff0000}/removeactor [actor id] > {8B0000}removes specified actor\n{A9A9A9}** {ff0000}/removeallactors > {8B0000}clears all actors");
  433.         format(text2,sizeof(text2),"\n{A9A9A9}** {ff0000}/gotoactor [actor id] > {8B0000}TP you to the actor's POS (position)\n{A9A9A9}** {ff0000}/setactoranim [animation name] > {8B0000}Set an anim on actor\n{ff0000}    ANIMATIONS: {8B0000}handsup / lean / sit / injured / dance / laugh / hide / dealstance / crossarms / riotchant / wave / talk / fucku / tired");
  434.         format(text3,sizeof(text3),"\n{A9A9A9}** {ff0000}/cancelactoranim [actor id] > {8B0000}cancels the anim that has been excuted on the actor\n{A9A9A9}** {ff0000}/actorstext > {8B0000}shows/hides all actors text\n{A9A9A9}** {ff0000}/updateactor [actor id] [skin id] [vulnerability] > {8B0000}updates specified actor's skin and vulnerability (Also updates rotation, view where you want and apply command!)");
  435.         format(everything,sizeof(everything),"%s %s %s",text,text2,text3);
  436.         ShowPlayerDialog(playerid, DIALOG_ACTORHELP, DIALOG_STYLE_MSGBOX, "Actor system commands",everything,"OK","");
  437.     }
  438.     else return 0;
  439.     return 1;
  440. }
  441. ///////////////////////////////////////////////////
  442. CMD:updateactor(playerid,params[])
  443. {
  444.     if(IsPlayerAdmin(playerid))
  445.     {
  446.         new actorid,skinid,invulnerability,Float:Pos[3],Float:Angle,str[256],str2[256];
  447.         if(sscanf(params,"iil",actorid,skinid,invulnerability)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /updateactor [actor id] [skin id] [vulnerability]");
  448.         if(!IsValidActor(actorid)) return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
  449.         if(skinid > 311 || skinid < 0) return SendClientMessage(playerid,COLOR_RED,"Invalid skin id!");
  450.         if(invulnerability > 1 || invulnerability < 0) return SendClientMessage(playerid,COLOR_RED,"Vulnerability (0: invulnerable / 1: vulnerable)");
  451.         GetPlayerFacingAngle(playerid, Angle);
  452.         GetActorPos(actorid,Pos[0],Pos[1],Pos[2]);
  453.         DestroyActor(actorid);
  454.         new actorid2 = CreateActor(skinid, Pos[0], Pos[1], Pos[2], 0);
  455.         SetActorFacingAngle(actorid2, Angle);
  456.         format(str2,sizeof(str2),"Actor ID: %d",actorid2);
  457.         ClearLabel(actorid);
  458.         aLabels[actorid2][label_ID] = Create3DTextLabel(str2, COLOR_YELLOW, Pos[0], Pos[1], Pos[2], 10, 0, 0);
  459.         format(str,sizeof(str),"You have updated actor %i. (new info: skin: %i, Vul: %i, ID: %i)",actorid,skinid,invulnerability,actorid2);
  460.         SendClientMessage(playerid,COLOR_GREEN,str);
  461.         for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
  462.         {
  463.             if(ActorText[i] == 1)
  464.             {
  465.                 ActorText[actorid2] = 1;
  466.             }
  467.             else if(ActorText[i] == 0)
  468.             {
  469.                 ActorText[actorid2] = 0;
  470.                 ClearLabel(actorid2);
  471.             }
  472.         }
  473.         if(invulnerability == 0)
  474.         {
  475.             SetActorInvulnerable(actorid2, 1);
  476.             SendClientMessage(playerid,COLOR_GREEN,"This actor is invulnerable!");
  477.         }
  478.         else if(invulnerability == 1)
  479.         {
  480.             SetActorHealth(actorid2, 100);
  481.             SetActorInvulnerable(actorid2,0);
  482.             SendClientMessage(playerid,COLOR_GREEN,"This actor is vulnerable!");
  483.         }
  484.     }
  485.     else return 0;
  486.     return 1;
  487. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement