login
March 28, 2024, 10:41:09 pm

Author Topic: [Pawn]Need help  (Read 1755 times)

0 Members and 1 Guest are viewing this topic.

Inferno

  • Crazy Man
  • *****
  • Posts: 478
  • Frontline-battles! :D
    • View Profile
[Pawn]Need help
« on: August 16, 2011, 04:24:15 pm »
I made a set timer in my server,now problem is that the code takes only id 0 the to tutorial.Ill paste the tutorial script
public tut()
{
new playerid;
SendClientMessage(playerid,0xFFFF00AA,"Some of the stunt places will be displayed in this tut,here is the Wall Grab Arena");
SendClientMessage(playerid,0xFFFF00AA,">>>>>>>>Lets proceed further...Loading..<<<<<<<<");
SetPlayerPos(playerid,-25.66960906,949.94708251,10.94025325);
SetTimer("tut2",3000,0);


Pls someone tell me how to define that "playerid" Only thats the problem.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Zeke

  • Crazy Man
  • *****
  • Posts: 935
  • Country: bg
  • VC:MP and LU beta tester
    • View Profile
Re: [Pawn]Need help
« Reply #1 on: August 16, 2011, 04:58:30 pm »
SetPlayerPos(playerid,-25.66960906,949.94708251,10.94025325);

Instead of playerid use plr the line will be this:

Code: [Select]
SetPlayerPos(plr,-25.66960906,949.94708251,10.94025325);
Im not sure but i think it will work.

Am anyways guys i got a problem in pawno too its about a jail its like argo but my jail only jails ID 0 i tryed with plr but no shit here is the code: http://pastebin.com/t9EUu4sg
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Quote
InstallHook(0x405AC0,(DWORD)CantFindFuckingAnim,0x405A95,
CantFindFuckingAnim_HookJmpCode,sizeof(CantFindFuckingAnim_HookJmpCode));
-------------------------------------------------
Quote
[00:41:12] <~Murdock> actually just transfering files
[00:41:16] <~Murdock> sounds, clientscripts etc
[00:42:05] <heekzs> what transfer method you uses
[00:43:03] <~Murdock> speed of light

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1755
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
Re: [Pawn]Need help
« Reply #2 on: August 16, 2011, 05:23:40 pm »
You only use new playerid and never set it to anything. This defaults it to 0. This would be much easier to pull off in Squirrel, where passing parameters to timers... err... works.

You could set playerid outside of the timer like this:
Code: [Select]
new tutorialPlayer = -1;
public tut()
{
    SendClientMessage(tutorialPlayer, // ..........
    // ............
}

And do this on /c  tut:
Code: [Select]
if(tutorialPlayer > -1) SendClientMessage(playerid, 0xFFFF00AA, "Wait a minute and try again.");
else tutorialPlayer = playerid;

And set tutorialPlayer back to -1 at the end, though this would produce undesirable wait times if multiple people wanted to use the tutorial at the same time.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

<krystianoo> stormeus do good job
<krystianoo> with recent update
<krystianoo> if not agree; jeb yourself in head
<Avenger> yesterday you said death to stormeus
<karan> double standard krystianoo
<karan> he called him fake prophet too
<krystianoo> sure fake prophet
<krystianoo> but with recent updates real

Zeke

  • Crazy Man
  • *****
  • Posts: 935
  • Country: bg
  • VC:MP and LU beta tester
    • View Profile
Re: [Pawn]Need help
« Reply #3 on: August 16, 2011, 08:41:51 pm »
Any one got idea how to fix my jail  ???
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Quote
InstallHook(0x405AC0,(DWORD)CantFindFuckingAnim,0x405A95,
CantFindFuckingAnim_HookJmpCode,sizeof(CantFindFuckingAnim_HookJmpCode));
-------------------------------------------------
Quote
[00:41:12] <~Murdock> actually just transfering files
[00:41:16] <~Murdock> sounds, clientscripts etc
[00:42:05] <heekzs> what transfer method you uses
[00:43:03] <~Murdock> speed of light

Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Re: [Pawn]Need help
« Reply #4 on: August 16, 2011, 11:16:24 pm »
Or you could assign the timer into an array slot. If you make an array with one slot for every player-slot and then set the timer within the respective array slot it should work. Edit- I just realised that you have timers within the functions, like 5 timers I guess from seeing your server earlier. This method would be an absolute faf, a bad usage of time and effort when there is a simple alternative available imo.

But as Stormeus said, the best solution would be to use Squirrel. The NewTimer function is far better than SetTimer.


Any one got idea how to fix my jail  ???

What jail? Post another topic.
« Last Edit: August 16, 2011, 11:52:06 pm by Cutton »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


Inferno

  • Crazy Man
  • *****
  • Posts: 478
  • Frontline-battles! :D
    • View Profile
Re: [Pawn]Need help
« Reply #5 on: August 17, 2011, 05:40:17 pm »
Nvm,i am learning squirrel now.Trying to leave pawn :P
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor