Need some help ;]
#1

Hello. I'm trying to do that when player hungs up trailer, server will show checkpoint for him. But when I hung up trailer, server shows me nothing.
Код:
forward priekaba(playerid);

public priekaba(playerid)
{
  for(new k = 0; k < MAX_VEHICLES; k++)
  {
		if(IsTrailerAttachedToVehicle(k))
		{
			picaDB[playerid][Picanumber] = SetPlayerCheckpoint(playerid,picaarray[picaDB[playerid][Picanumber]][0],picaarray[picaDB[playerid][Picanumber]][1],picaarray[picaDB[playerid][Picanumber]][2],6.0);
			}
			else
			{
			DisablePlayerCheckpoint(playerid) ;
		}
	}
}

SetTimer("Priekaba",100,true);
Can someone help me?
Reply
#2

Playerid is useless to have in that callback because the timer doesn't state which player and it has a loop anyway.


What you should do is have the loop go to MAX_PLAYERS, and check to see if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid)))

also "Picanumber" isn't being defined on your snippet there.
Reply
#3

Код:
forward priekaba();
Код:
public priekaba()
{
  for(new k = 0; k < MAX_PLAYERS; k++)
  {
		if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(k)))
		{
			picaDB[k][Picanumber] = SetPlayerCheckpoint(k,picaarray[picaDB[k][Picanumber]][0],picaarray[picaDB[k][Picanumber]][1],picaarray[picaDB[k][Picanumber]][2],6.0);
			}
			else
			{
			DisablePlayerCheckpoint(k) ;
		}
	}
}
Код:
SetTimer("Priekaba",100,true);
But it still doesn't works.
Reply
#4

Sorry for double posting, but I really need this script. Maybe someone know how to do when I hung up trailer, server would show me checkpoints?
Reply
#5

Maybe someone can tell me how to know trailer's ID? Don't tell me this --> https://sampwiki.blast.hk/wiki/GetVehicleTrailer I need correct answer.
Reply
#6

Use SetTimerEx ..
Reply
#7

Quote:
Originally Posted by Abernethy
Use SetTimerEx ..
Can you show me how it should looks? Because I've never before used SetTimerEx.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)