Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:spawnactor(playerid, params[])
- {
- new Float:Pos[3],skinid,str[256],bool:invulnerability,Float:Angle;
- if(sscanf(params,"il",skinid,invulnerability)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /spawnactor [skinid] [Vulnerability (0: invulnerable / 1: vulnerable)]");
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
- GetPlayerFacingAngle(playerid, Angle);
- new Actor = CreateActor(skinid, Pos[0], Pos[1], Pos[2], 0);
- SetPlayerPos(playerid,Pos[0]+1,Pos[1]+1,Pos[2]);
- SetActorFacingAngle(Actor, Angle);
- format(str,sizeof(str),"Actor %d was created! Pos: x[%f], y[%f], z[%f]",Actor,Pos[0],Pos[1],Pos[2]);
- SendClientMessage(playerid,COLOR_GREEN,str);
- if(invulnerability == false)
- {
- SetActorInvulnerable(Actor, true);
- SendClientMessage(playerid,COLOR_GREEN,"This actor is invulnerable!");
- }
- else if(invulnerability == true)
- {
- SetActorInvulnerable(Actor,false);
- SendClientMessage(playerid,COLOR_GREEN,"This actor is vulnerable!");
- }
- return 1;
- }
- CMD:removeactor(playerid, params[])
- {
- new actorid,str[256];
- if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /removeactor [actor id]");
- format(str,sizeof(str),"Actor %d was removed!",actorid);
- if(IsValidActor(actorid))
- {
- SendClientMessage(playerid,COLOR_GREEN,str);
- DestroyActor(actorid);
- }
- return 1;
- }
- CMD:clearallactors(playerid, params[])
- {
- for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
- {
- if(IsValidActor(i))
- {
- DestroyActor(i);
- }
- }
- return 1;
- }
- CMD:gotoactor(playerid, params[])
- {
- new Float:Pos[3],actorid,str[256];
- if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /gotoactor [actor id]");
- GetActorPos(actorid,Pos[0],Pos[1],Pos[2]);
- SetPlayerPos(playerid,Pos[0]+3,Pos[1],Pos[2]+8);
- format(str,sizeof(str),"You have been teleported to actor %d!",actorid);
- SendClientMessage(playerid,COLOR_GREEN,str);
- return 1;
- }
- CMD:allactors(playerid, params[])
- {
- new str[400];
- for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
- {
- if(IsValidActor(i))
- {
- format(str,sizeof(str),"Actor: %d | vulnerability: %d",i,!IsActorInvulnerable(i));
- SendClientMessage(playerid,COLOR_GREEN,str);
- }
- }
- return 1;
- }
- CMD:setactoranim(playerid, params[])
- {
- new animation[256],actorid,str[256];
- if(sscanf(params,"is[100]",actorid,animation)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /setactoranim [actor id] [animation]");
- if(IsValidActor(actorid))
- {
- if(strcmp(animation, "injured") == 0)
- {
- ApplyActorAnimation(actorid, "SWEET", "Sweet_injuredloop", 4.1, 1, 0, 0, 0, 0);
- ApplyActorAnimation(actorid, "SWEET", "Sweet_injuredloop", 4.1, 1, 0, 0, 0, 0);
- format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
- SendClientMessage(playerid,COLOR_GREEN,str);
- }
- if(strcmp(animation, "handsup") == 0)
- {
- ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 1, 0, 0, 0, 0);
- ApplyActorAnimation(actorid, "SHOP", "SHP_Rob_HandsUp", 4.1, 1, 0, 0, 0, 0);
- format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
- SendClientMessage(playerid,COLOR_GREEN,str);
- }
- if(strcmp(animation, "aim") == 0)
- {
- ApplyActorAnimation(actorid, "SHOP", "SHP_Gun_Aim", 4.1, 1, 0, 0, 0, 0);
- ApplyActorAnimation(actorid, "SHOP", "SHP_Gun_Aim", 4.1, 1, 0, 0, 0, 0);
- format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
- SendClientMessage(playerid,COLOR_GREEN,str);
- }
- if(strcmp(animation, "sit") == 0)
- {
- ApplyActorAnimation(actorid, "BEACH", "ParkSit_M_loop", 4.1, 1, 0, 0, 0, 0);
- ApplyActorAnimation(actorid, "BEACH", "ParkSit_M_loop", 4.1, 1, 0, 0, 0, 0);
- format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
- SendClientMessage(playerid,COLOR_GREEN,str);
- }
- if(strcmp(animation, "lean") == 0)
- {
- ApplyActorAnimation(actorid, "GANGS", "leanIDLE", 4.1, 1, 0, 0, 0, 0);
- ApplyActorAnimation(actorid, "GANGS", "leanIDLE", 4.1, 1, 0, 0, 0, 0);
- format(str,sizeof(str),"Applied animation '%s' on Actor %d",animation,actorid);
- SendClientMessage(playerid,COLOR_GREEN,str);
- }
- }
- else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
- return 1;
- }
- CMD:cancelactoranim(playerid, params[])
- {
- new actorid;
- if(sscanf(params,"i",actorid)) return SendClientMessage(playerid,COLOR_PURPLE,"USAGE: /cancelactoranim [actor id]");
- if(IsValidActor(actorid))
- {
- ClearActorAnimations(actorid);
- SendClientMessage(playerid,COLOR_GREEN,"Animation canceled!");
- }
- else return SendClientMessage(playerid,COLOR_RED,"Invalid actor id!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement