07.03.2012, 22:08
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return 1;
PlayerInfo[playerid][pSelection] = 0;
SetTimerEx("SpawnPlayerEx", 75, false, "i", playerid);
new Preloading[3];//preload objects
Preloading[0] = CreatePlayerObject(playerid, Machine_Gun, TM_SELECTION_X, TM_SELECTION_Y + 5, TM_SELECTION_Z, 0.0, 0.0, 0.0, 300.0);
Preloading[1] = CreatePlayerObject(playerid, Missile_Default_Object, TM_SELECTION_X, TM_SELECTION_Y + 5, TM_SELECTION_Z, 0.0, 0.0, 0.0, 300.0);
Preloading[2] = CreatePlayerObject(playerid, Missile_Napalm_Object, TM_SELECTION_X, TM_SELECTION_Y + 5, TM_SELECTION_Z, 0.0, 0.0, 0.0, 300.0);
SendClientMessageFormatted(playerid, -1, "0: %d - 1: %d - 2: %d", Preloading[0], Preloading[1], Preloading[2]);
SetTimerEx("FinishPreloading", 2000, false, "iiii", playerid, Preloading[0], Preloading[1], Preloading[2]);
return 1;
}
forward FinishPreloading(playerid, ...);
public FinishPreloading(playerid, ...)
{
new iArgs = numargs();
while(--iArgs)
{
SendClientMessageFormatted(playerid, -1, "player objectid: %d - arg: %d", getarg(iArgs), iArgs);
DestroyPlayerObject(playerid, getarg(iArgs));
}
return 1;
}
Код:
[19:11:34] 0: 19 - 1: 20 - 2: 21 [19:11:39] player objectid: 1090519040 - arg: 3 [19:11:39] player objectid: 67 - arg: 2 [19:11:39] player objectid: 17152 - arg: 1