SA-MP Forums Archive
Wait function? - 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)
+--- Thread: Wait function? (/showthread.php?tid=464651)



Wait function? - CesarLT - 18.09.2013

Hello everyone, I am trying to create a sky diving FS, and I need to have a "pause/wait" function for a few seconds before the player recives a parachute while in sky already..is there anyway to do it?

For those who didn't understand:

pawn Код:
CMD:skydive(playerid, params[]);
  {
    SetPlayerPos(playerid, 1763.6770,-1385.8885,20005.7148);
    SendClientMessage(playerid, COLOR_YELLOW, "[TELEPORT] {FFFFFF}- You've been teleported to skydive map . Enjoy your flight.");
    SendClientMessage(playerid, COLOR_RED, "[ERROR, error, ErRoR...] {FFFFFF}- We failed to give you a parachute, we hope to fix the problem shortly!");


// Wait a few seconds function here


//Later on giveplayerwep...
   
  }
Thanks in advance!


EDIT: I am reciving this 2 error lines when compiling, what does that mean?


pawn Код:
C:\Users\Arty\Desktop\test.pwn(117) : error 055: start of function body without function header
C:\Users\Arty\Desktop\test.pwn(121) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Re: Wait function? - Konstantinos - 18.09.2013

pawn Код:
CMD:skydive(playerid, params[]);
  {
    SetPlayerPos(playerid, 1763.6770,-1385.8885,20005.7148);
    SendClientMessage(playerid, COLOR_YELLOW, "[TELEPORT] {FFFFFF}- You've been teleported to skydive map . Enjoy your flight.");
    SendClientMessage(playerid, COLOR_RED, "[ERROR, error, ErRoR...] {FFFFFF}- We failed to give you a parachute, we hope to fix the problem shortly!");
    SetTimerEx("OnPlayerGiveParachute", 5000, false, "i", playerid);
    return 1;
}

forward OnPlayerGiveParachute(playerid);
public OnPlayerGiveParachute(playerid)
{
    GivePlayerWeapon(playerid, 46);
}
EDIT: Show us the code in these lines.


Re: Wait function? - CesarLT - 18.09.2013

pawn Код:
CMD:skydive(playerid, params[]);
  {  //line 117
    SetPlayerPos(playerid, 1763.6770,-1385.8885,20005.7148);
    SendClientMessage(playerid, COLOR_YELLOW, "[TELEPORT] {FFFFFF}- You've been teleported to skydive map . Enjoy your flight.");
    SendClientMessage(playerid, COLOR_RED, "[ERROR, error, ErRoR...] {FFFFFF}- We {FF0000}failed{FFFFFF} to give you a parachute, pray to recive one shortly!");
    return 1; //line 121
  }

Error lines:

pawn Код:
C:\Users\Arty\Desktop\test.pwn(117) : error 055: start of function body without function header
C:\Users\Arty\Desktop\test.pwn(121) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

Your code showed the same, but line this:

pawn Код:
C:\Users\Arty\Desktop\test.pwn(117) : error 055: start of function body without function header
C:\Users\Arty\Desktop\test.pwn(122) : error 010: invalid function or declaration
C:\Users\Arty\Desktop\test.pwn(128) : warning 202: number of arguments does not match definition // "GivePlayerWeapon" ??
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Re: Wait function? - Konstantinos - 18.09.2013

I forgot the ammo:
pawn Код:
GivePlayerWeapon(playerid, 46, 1);
About the rest, it's:
pawn Код:
CMD:skydive(playerid, params[])
Do not use a semicolon ; after params[])


Re: Wait function? - CesarLT - 18.09.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I forgot the ammo:
pawn Код:
GivePlayerWeapon(playerid, 46, 1);
About the rest, it's:
pawn Код:
CMD:skydive(playerid, params[])
Do not use a semicolon ; after params[])
Ah, damn my bad lol. How could I miss that -.- Anyways, thank you!