{HELP}Dumper job
#1

Hiya guys im working on a dumper job and all works fine but i have one problem... i cant figure out how to freeze the dumper for 5 secons when the checkpoint.. and for the client msg to say loading then 5 sec l8ter collected and then make the player controlable any help appreaciated with this as im stuck

Thanks

[quote]

IsCollecting[playerid] = 0;

else if(IsCollecting[playerid] >0)
{
new tmpcar2 = GetPlayerVehicleID(playerid);
new tmpcar = GetPlayerVehicleID(playerid);
if(IsADumper(tmpcar2))
{
if(IsCollecting[playerid]==1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rubbish loading.");
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rubbish Collected.");
TogglePlayerControllable(playerid, 1);
SetPlayerCheckpoint(playerid, -404.1214,-1300.5642,30.7730,8.0);
IsCollecting[playerid] = 2;
}
else if(IsCollecting[playerid]==2)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rubbish loading.");
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rubbish Collected.");
TogglePlayerControllable(playerid, 1);
SetPlayerCheckpoint(playerid, -466.5224,-1296.8861,33.4559,8.0);
IsCollecting[playerid] = 3;

}
Reply
#2

use freezeplayer with a timer on 5 seconds?
Reply
#3

can i have an example plz
Reply
#4

Ive got this but im getting errors ile highlight them in script green for ya can u guys help

C:\DOCUME~1\Andy\Desktop\samp\gamemodes\TRRp.pwn(7 59) : warning 215: expression has no effect
C:\DOCUME~1\Andy\Desktop\samp\gamemodes\TRRp.pwn(7 64) : warning 215: expression has no effectfect

[quote]

new Freezetimer;

forward FreezePlayer(playerid,time);


public GameModeExitFunc()
{

KillTimer(Freezetimer);
GameModeExit();
}


Freezetimer = SetTimer("Freeze", 5000, 1);



public FreezePlayer(playerid,time)
{
new Freeze[MAX_PLAYERS];

if(Freeze[playerid] == 0) {
TogglePlayerControllable(playerid,0);
Freeze[playerid] == 1;
}
else
{
TogglePlayerControllable(playerid,1);
Freeze[playerid] == 0;
}
return 1;
}
Reply
#5

pawn Код:
Freeze[playerid] = 0;
Freeze[playerid] = 1;
Reply
#6

Thanks that works but now when i go threw the marker it dont freeze me for 5 seconds ?? any ideas in what im doing wrong guys

[quote]



new Freezetimer;
forward FreezePlayer(playerid,time);

public GameModeExitFunc()
{

KillTimer(Freezetimer);
GameModeExit();
}

Freezetimer = SetTimer("Freeze", 5000, 1);

public FreezePlayer(playerid,time)
{
new Freeze[MAX_PLAYERS];

if(Freeze[playerid] == 0) {
TogglePlayerControllable(playerid,0);
Freeze[playerid] == 1;
}
else
{
TogglePlayerControllable(playerid,1);
Freeze[playerid] == 0;
}
return 1;
}
//----------------------------------------------------------
if(IsHarvesting[playerid] >0)
{
new tmpcar2 = GetPlayerVehicleID(playerid);
new tmpcar = GetPlayerVehicleID(playerid);
new Freeze[MAX_PLAYERS];
if(IsAHarvester(tmpcar2))
{
if(IsHarvesting[playerid]==1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Field Harvested.");
SetPlayerCheckpoint(playerid, -404.1214,-1300.5642,30.7730,8.0);
freeze[playerid] = 0;
endClientMessage(playerid, COLOR_LIGHTBLUE, "Field done.");
IsHarvesting[playerid] = 2;
}
Reply
#7

Have you used:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
as I cannot see it there.
Reply
#8

Yea i already done that it up script a bit i just coppyed the section im stuck on but yea public OnPlayerEnterCheckpoint(playerid) is there and all the checkpoints work fine the problem im having is that it isint freezing me for 5 secs when i enter the point??
Reply
#9

pawn Код:
forward FreezePlayer(playerid);

public FreezePlayer(playerid)
{
  TogglePlayerControllable(playerid,1);
  DisablePlayerCheckpoint(playerid);
  return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
  TogglePlayerControllable(playerid,0);
  SetTimerEx("FreezePlayer", 5000, 0, "i", playerid);
  return 1;
}
I know this simple method works as I have tested on foot and in vehicle. If you forget the rest of your code for the moment and get the freezing right then you can put it into your code. I did a simple test like spawning in checkpoint, then spawned away from it and drove a car there.
Reply
#10

Thanks man that work ad also alot les code than my attempt
greate on cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)