Vice Underdogs

Scripting => Scripting Support => Topic started by: Inferno on August 16, 2011, 04:24:15 pm

Title: [Pawn]Need help
Post by: Inferno 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.
Title: Re: [Pawn]Need help
Post by: Zeke 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
Title: Re: [Pawn]Need help
Post by: stormeus 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.
Title: Re: [Pawn]Need help
Post by: Zeke on August 16, 2011, 08:41:51 pm
Any one got idea how to fix my jail  ???
Title: Re: [Pawn]Need help
Post by: Charley 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.
Title: Re: [Pawn]Need help
Post by: Inferno on August 17, 2011, 05:40:17 pm
Nvm,i am learning squirrel now.Trying to leave pawn :P