Need some help ;] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need some help ;] (
/showthread.php?tid=86645)
Need some help ;] -
lakierka - 15.07.2009
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?
Re: Need some help ;] -
Joe Staff - 15.07.2009
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.
Re: Need some help ;] -
lakierka - 15.07.2009
Код:
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.
Re: Need some help ;] -
lakierka - 15.07.2009
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?
Re: Need some help ;] -
lakierka - 16.07.2009
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.
Re: Need some help ;] -
Abernethy - 16.07.2009
Use SetTimerEx ..
Re: Need some help ;] -
lakierka - 16.07.2009
Quote:
Originally Posted by Abernethy
Use SetTimerEx ..
|
Can you show me how it should looks? Because I've never before used SetTimerEx.