20.12.2010, 09:27
Nice, however this code isn't going to work:
playerid will always be '0' as no values are entered. This of course worked during testing as you were ID 0, but for others this will not work.
You need to use a loop:
pawn Код:
public OnFilterScriptInit()
{
SetTimer("Bounce", 750, true);
return 1;
}
forward Bounce(playerid);
public Bounce(playerid)
{
new Float:x, Float:y, Float:z;
GetObjectPos(trampoline, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 2.25, x, y, z+2.0))
{
SetPlayerVelocity(playerid, 0.0, 0.0, 0.5);
}
}
You need to use a loop:
pawn Код:
forward Bounce();
public Bounce()
{
new Float:x, Float:y, Float:z;
GetObjectPos(trampoline, x, y, z);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 2.25, x, y, z+2.0))
{
SetPlayerVelocity(i, 0.0, 0.0, 0.5);
}
}
}