15.11.2010, 19:59
(
Last edited by [WSF]ThA_Devil; 20/11/2010 at 01:06 PM.
)
When i was bored i made this.... this can be used for any object streamer...
Did you have sometimes when you teleport to somewhere and you fall trough objects? This is way to fix it!
Some Info:
Doesn't matter how much heal have player but if player have 0 heal this won't work
Screens? :
when objects are loading:
when objects are loaded:
about image when Objects was loaded thats a little bug.... you don't see objects but you can walk on them....
it won't happen if you teleport to there twice in 1 minute....
Lets get started!
This can be in any FILTERSCRIPT/GAMEMODE
so we need to forward Callbacks!
so.... when we have that.... we will need godmode.... to disable unfair kills in dm!
and now we need to make Callbacks now:
Standart (2 seconds timer )
Im using SetTimerEx because its able to set timer for one player not all... so.... noone gets freezed only yoU!
TogglePlayerControllable(playerid,0); its just freezing you.... important line....
GameTextForPlayer(playerid,"~w~Objects ~r~Loading",1000,5); isn't important line... you can delete it if you dont want to have it....
Whats about that when timer ends? you should unfreeze player....
TogglePlayerControllable(playerid,1); unfreezing player
same as before! GameTextForPlayer(playerid,"~w~Objects ~g~Loaded",6000,5); isnt important one.... because its effect is announcing text (may be removed*)
don't want fall trough death mach objects? or don't want to be unfair killed?
see how its done down here.....
Explaining things:
SetPlayerHealth(playerid, GOD_ON); Sets player heal to unkillable.... (you wont have unfair kills with this lane...)
SetTimerEx("LoadedDmObjects",2000,false,"i",player id); Sets timer just for player
TogglePlayerControllable(playerid,0); As i told this freezes player
GameTextForPlayer sends announce text for player.....
SetPlayerHealth(playerid, GOD_OFF); sets players heal to 100... makes him killable
and you should undarstand whats all in that.... if you don't read topic again!
Custom timer Loaders:
im using ''LoadedObjects'' again because doesn't need to make LoadedTimedObjects.... its just.... filling script palace
''Time*1000'' means that:
i use some nummber as 4
4 = Time
4*1000 is 4 seconds or 4000
thats how does that work.....
if you don't undarstand how this work read about LoadTimedObjects(playerid,Time)
there isn't big difference about LoadDmObjects or LoadTimedDmObjects.... just custom timer....
As ****** said i ll make and show how to use it!
you can use that in teleports:
warning* im using ZCMD.... you can change it to any command format.....
simple commands:
you can use that when player spawns
or you could use:
None bugs found.... found a bug? pm me....
so..... as you can see i use ''2'' not ''2000'' because milliseconds doesn't support my function right......
and it dont work as i want to....
any questions?
and thats it!
sry for my sh*ty grammar... xD
Did you have sometimes when you teleport to somewhere and you fall trough objects? This is way to fix it!
Some Info:
Doesn't matter how much heal have player but if player have 0 heal this won't work
Screens? :
when objects are loading:
when objects are loaded:
about image when Objects was loaded thats a little bug.... you don't see objects but you can walk on them....
it won't happen if you teleport to there twice in 1 minute....
Lets get started!
This can be in any FILTERSCRIPT/GAMEMODE
so we need to forward Callbacks!
Code:
forward LoadObjects(playerid); //with standart load time 2 secs forward LoadedObjects(playerid); forward LoadDmObjects(playerid); //with standart load time 2 secs forward LoadedDmObjects(playerid); //timed forward LoadTimedObjects(playerid,Time); //you need to change Time in your gamemode / include to time what you want loading! (in seconds) forward LoadTimedDmObjects(playerid,Time); // same but in deathmach!
pawn Code:
#define GOD_ON 100000
#define GOD_OFF 100
Standart (2 seconds timer )
pawn Code:
public LoadObjects(playerid)
{
SetTimerEx("LoadedObjects",2000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~Objects ~r~Loading",1000,5);
return 1;
}
TogglePlayerControllable(playerid,0); its just freezing you.... important line....
GameTextForPlayer(playerid,"~w~Objects ~r~Loading",1000,5); isn't important line... you can delete it if you dont want to have it....
Whats about that when timer ends? you should unfreeze player....
pawn Code:
public LoadedObjects(playerid)
{
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~w~Objects ~g~Loaded",6000,5);
return 1;
}
same as before! GameTextForPlayer(playerid,"~w~Objects ~g~Loaded",6000,5); isnt important one.... because its effect is announcing text (may be removed*)
don't want fall trough death mach objects? or don't want to be unfair killed?
see how its done down here.....
pawn Code:
public LoadDmObjects(playerid)
{
SetPlayerHealth(playerid, GOD_ON);
SetTimerEx("LoadedDmObjects",2000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~Deathmatch ~r~Loading",2000,5);
return 1;
}
SetPlayerHealth(playerid, GOD_ON); Sets player heal to unkillable.... (you wont have unfair kills with this lane...)
SetTimerEx("LoadedDmObjects",2000,false,"i",player id); Sets timer just for player
TogglePlayerControllable(playerid,0); As i told this freezes player
GameTextForPlayer sends announce text for player.....
pawn Code:
public LoadedDmObjects(playerid)
{
SetPlayerHealth(playerid, GOD_OFF);
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~w~Deathmatch ~g~Loaded",6000,5);
return 1;
}
and you should undarstand whats all in that.... if you don't read topic again!
Custom timer Loaders:
pawn Code:
public LoadTimedObjects(playerid,Time) //replace time with your own defined in secs
{
SetTimerEx("LoadedObjects",Time*1000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~Objects ~r~Loading",1000,5);
return 1;
}
''Time*1000'' means that:
i use some nummber as 4
4 = Time
4*1000 is 4 seconds or 4000
thats how does that work.....
pawn Code:
public LoadTimedDmObjects(playerid,Time)
{
SetPlayerHealth(playerid, GOD_ON);
SetTimerEx("LoadedDmObjects",Time*1000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~Deathmatch ~r~Loading",2000,5);
return 1;
}
there isn't big difference about LoadDmObjects or LoadTimedDmObjects.... just custom timer....
As ****** said i ll make and show how to use it!
you can use that in teleports:
warning* im using ZCMD.... you can change it to any command format.....
pawn Code:
CMD:dm1(playerid, params[]) {
LoadTimedDmObjects(playerid,2); // i have replaced time with 2.... thats timer in seconds how long you want to load
SetPlayerPos(playerid,Float:X,Float:Y,Float:Z); // and this..... yea..... teleport.... xD
}
return 1;
}
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/airdrift", true)) // you can change airdrift to anything else
{
LoadTimedObjects(playerid,2); // or use LoadObjects(playerid,);
SetPlayerPos(playerid,Float:X,Float:Y,Float:Z); // teleport (float)
return 1;
}
return 0;
}
pawn Code:
public OnPlayerSpawn(playerid);
}
LoadObjects(playerid);
return 1;
}
pawn Code:
public OnPlayerSpawn(playerid);
}
LoadTimedObjects(playerid,4);
return 1;
}
so..... as you can see i use ''2'' not ''2000'' because milliseconds doesn't support my function right......
and it dont work as i want to....
any questions?
and thats it!
sry for my sh*ty grammar... xD