Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include < a_samp >
  2. #include < a_actor >
  3. #include < file >
  4. #include < YSI\y_ini >
  5. #include < YSI\y_commands >
  6. #include < sscanf2 >
  7.  
  8. #define ACTORS "/Actors/%s.ini"
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" Dinamicno kreiranje aktora by Unkovic");
  14. print("--------------------------------------\n");
  15. return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20. return 1;
  21. }
  22.  
  23. YCMD:kreirajaktora(playerid, params[], help)
  24. {
  25. #pragma unused help
  26. new model, invulnerable, name;
  27. new Float:X, Float:Y, Float:Z, Float:A;
  28. GetPlayerPos(playerid, X, Y, Z);
  29. GetPlayerFacingAngle(playerid, A);
  30. if(sscanf(params, "s[80]dd", name, model, invulnerable)) return SendClientMessage(playerid, -1, "Koristi: /kreirajaktora [ime][skin][invulnerable 1/0]");
  31. if(invulnerable > 1) return SendClientMessage(playerid, -1, "Ne moze preko 1");
  32. CreateActor(model, X, Y, Z, A);
  33.  
  34. new file[ 60 ];
  35. format( file, sizeof( file ), ACTORS, name );
  36. new File:actor = fopen( file, io_write);
  37.  
  38. new str[128];
  39. new string1[128];
  40.  
  41. format(string1, sizeof(string1), "SetActorInvulnerable(actorid, %d)", invulnerable);
  42.  
  43. format(str, sizeof(str), "CreateActor(%d, %f, %f, %f, %f)", model, X, Y, Z, A);
  44.  
  45.  
  46. fwrite( actor, str );
  47. fwrite( actor, string1 );
  48. fclose( actor );
  49.  
  50. return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement