Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < a_samp >
- #include < a_actor >
- #include < file >
- #include < YSI\y_ini >
- #include < YSI\y_commands >
- #include < sscanf2 >
- #define ACTORS "/Actors/%s.ini"
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Dinamicno kreiranje aktora by Unkovic");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- YCMD:kreirajaktora(playerid, params[], help)
- {
- #pragma unused help
- new model, invulnerable, name;
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- if(sscanf(params, "s[80]dd", name, model, invulnerable)) return SendClientMessage(playerid, -1, "Koristi: /kreirajaktora [ime][skin][invulnerable 1/0]");
- if(invulnerable > 1) return SendClientMessage(playerid, -1, "Ne moze preko 1");
- CreateActor(model, X, Y, Z, A);
- new file[ 60 ];
- format( file, sizeof( file ), ACTORS, name );
- new File:actor = fopen( file, io_write);
- new str[128];
- new string1[128];
- format(string1, sizeof(string1), "SetActorInvulnerable(actorid, %d)", invulnerable);
- format(str, sizeof(str), "CreateActor(%d, %f, %f, %f, %f)", model, X, Y, Z, A);
- fwrite( actor, str );
- fwrite( actor, string1 );
- fclose( actor );
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement