new DFCactor1;
new DFCactor2;
new DFCactor3;
public OnGameModeInit()
{
DFactor1= CreateActor(13,490.5765,-16.6661,1000.6797,12.1928);
if (!IsValidActor(DFactor1)) return DFactor1=CreateActor(13,490.5765,-16.6661,1000.6797,12.1928);
if (IsValidActor(DFactor1)) return ApplyActorAnimation(DFactor1,"DANCING","dance_loop",4.1,1,0,0,0,0);
// goes like this for every actor with different animations
}
enum actors{
DFactor1,
DFactor2,
DFactor3
}
new ActorID[actors];
public OnGameModeInit()
{
ActorID[FDactor1]=CreateActor(13,490.5765,-16.6661,1000.6797,12.1928);
if (!IsValidActor(ActorID[FDactor1])) return ActorID[FDactor1]=CreatActor(skinid,X,Y,Z,Xrotation);
if (IsValidActor(ActorID[FDactor1])) return ApplyActorAnimation(DFactor1,"DANCING","dance_loop",4.1,1,0,0,0,0);
// etc...
}
|
new ClubActors[50]; |
|
ClubActors[0] = CreateActor(13,490.5765,-16.6661,1000.6797,12.192 ;ClubActors[1] = CreateActor(13,490.5765,-16.6661,1000.6797,12.192 ;ClubActors[2] = CreateActor(13,490.5765,-16.6661,1000.6797,12.192 ;... etc. |
|
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_SPRINT) // Press sprint key { if(IsPlayerInRangeOfPoint(playerid, 2, x, y, z) // if someone is close doors etc. { SetPlayerInterior(playerid, 1); SetPlayerPos(playerid, x, y, z); SetPlayerFacingAngle(playerid, rot); TogglePlayerControllable(playerid, false); SetTimerEx("Unfreeze", 1000, false, "i", playerid); } } return 1; } forward Unfreeze(playerid); public Unfreeze(playerid) { TogglePlayerControllable(playerid, true); } |
new DFCactor[2];
public OnGameModeInit()
{
DFactor[00] = CreateActor(13, 490.5765, -16.6661, 1000.6797, 12.1928); // What does this actor do? (ex: shop clerk1)
DFactor[01] = CreateActor(13, x, y, Z, a); // What does this actor do? (ex: shop clerk2)
for(new i = 0; i < sizeof(DFCactor); i++)
{
ApplyActorAnimation(DFCactor[i], "DANCING", "dance_loop", 4.1, 1, 0, 0, 0, 0);
}
return 1;
}
CreateActorEx(skinid, Float:X, Float:Y, Float:Z, Float:Rotation, virtual_world = 0, vulnerable = 0)
{
new ActorEx = CreateActor(skinid, X, Y, Z, Rotation);
SetActorVirtualWorld(ActorEx, virtual_world);
SetActorInvulnerable(ActorEx, vulnerable);
return ActorEx;
}
|
PHP код:
And to save even more lines, like.. you could just use my custom function and just replace your code under OnGameModeInIt with the CreateActorEx PHP код:
|
new ActorClubDF1;
new ActorClubDF2;
new ActorClubDF3;
new ActorClubDF4;
new ActorBT;
new ActorBSmok;
new ActorSB;
new ActorBGuard;
new ActorBVIP1;
new ActorBVIP2;
public OnGameModeInit()
{
ActorClubDF1 = CreateActor(13,490.5765,-16.6661,1000.6797,12.1928);
if(!IsValidActor(ActorClubDF1)) return ActorClubDF1 =CreateActor(13,490.5765,-16.6661,1000.6797,12.1928);
if (IsValidActor(ActorClubDF1)) return ApplyActorAnimation(ActorClubDF1,"DANCING","dance_loop",4.1,1,0,0,0,0);
ActorClubDF2 = CreateActor(12,486.7554,-16.1958,1000.6797,112.2097);
if (!IsValidActor(ActorClubDF2)) return ActorClubDF2 =CreateActor(12,486.7554,-16.1958,1000.6797,112.2097);
if (IsValidActor(ActorClubDF2)) return ApplyActorAnimation(ActorClubDF2,"DANCING","dance_loop",4.1,1,0,0,0,0);
ActorClubDF3 = CreateActor(40,486.8140,-13.5157,1000.6797,330.1222);
if (!IsValidActor(ActorClubDF3)) return ActorClubDF3 = CreateActor(40,486.8140,-13.5157,1000.6797,330.1222);
if (IsValidActor(ActorClubDF3)) return ApplyActorAnimation(ActorClubDF3,"DANCING","dance_loop",4.1,1,0,0,0,0);
ActorClubDF4 = CreateActor(98,489.2302,-11.6520,1000.6797,346.3948);
if (!IsValidActor(ActorClubDF4)) return ActorClubDF4 = CreateActor(98,489.2302,-11.6520,1000.6797,346.3948);
if (IsValidActor(ActorClubDF4)) return ApplyActorAnimation(ActorClubDF4,"DANCING","dance_loop",4.1,1,0,0,0,0);
ActorBT = CreateActor(194,501.7032,-20.4166,1000.6797,86.8270);
if (!IsValidActor(ActorBT)) return ActorBT =CreateActor(194,501.7032,-20.4166,1000.6797,86.8270);
ActorBSmok = CreateActor(47,506.6170,-4.7541,1000.6797,93.5925);
if (!IsValidActor(ActorBSmok)) return ActorBSmok = CreateActor(47,506.6170,-4.7541,1000.6797,93.5925);
if (IsValidActor(ActorBSmok)) return ApplyActorAnimation(ActorBSmok,"SMOKING","F_smklean_loop",4.1,1,0,0,0,3000);
ActorSB = CreateActor(67,499.9749,-16.8377,1001,178.4166);
if (!IsValidActor(ActorSB)) return ActorSB =CreateActor(67,499.9749,-16.8377,1001,178.4166);
ActorBGuard = CreateActor(164,491.1101,-24.5151,1000.6797,6.9407);
if (!IsValidActor(ActorBGuard)) return ActorBGuard =CreateActor(164,491.1101,-24.5151,1000.6797,6.9407);
ActorBVIP1 = CreateActor(214,486.7241,-21.5209,1003.1094,357.3969);
if (!IsValidActor(ActorBVIP1)) return ActorBVIP1= CreateActor(214,486.7241,-21.5209,1003.1094,357.3969);
ActorBVIP2 = CreateActor(216,482.7236,-25.4783,1003.1094,359.3814);
if (!IsValidActor(ActorBVIP2)) return ActorBVIP2 = CreateActor(216,482.7236,-25.4783,1003.1094,359.3814);
if (IsValidActor(ActorBVIP2)) return ApplyAnimation(ActorBVIP2,"BAR","dnk_stndF_loop",4.0,1,0,0,0,0);
return 1;
}
|
It sounds as if, based on what changes you made to begin with, you have a "return" statement in your code. A return statement halts the sequential execution of that block of code at the return, therefore not executing the code after the return statement. |
\