Saving playerid's to new tutid;
#1

It's probably one of the most basic things in pwn, but I can't seem to figure it out, i'm not very good at searching either, a skill I really need to improve on, heck, I don't even know what it is I am searching for.

Код:
new tutid = -1;
Under my login command I have this

Код:
tutid = playerid;
I have a timer which /login sets off if you haven't done the tutorial(User files) the timer is like this
Код:
forward tutsteptime(playerid);

public tutsteptime(playerid)
{
  
	SendClientMessage(tutid, AQUAGREEN, "               ..:: Rules ::..");
}
All I need is so that tutid is saved per player, not for everyone, like a float I believe, as the tutorial is showing for my friend when he logs in as ID 0 then it's getting messed up when I log in, they sort of collide, it's very weird.

Anyway, I just need a way of tutid saving, because the playerid isn't functioning, it's only showing the messages for ID 0, thanks a lot guys.
Reply
#2

Then you need to array tutid.

new tutid[MAX_PLAYERS];

which you would use like this: tutid[playerid] = playerid;

But I dont see why you even need this in the first place. just use playerid?
Reply
#3

When I use playerid it only works for ID 0, I will test this idea immediately, thanks a lot.


EDIT: Can't test atm, my friend isnt on MSn, so I can't tell him to log into to get ID 0, as soon as he is I will test this.
Reply
#4

Nope, doesn't work, ID 1 doesn't get the timer set for him.

Are timers set for the whole server? If so, is there a way of only setting them for players. Like if ID 1 has to do the tutorial he does, because if I am ID 1 roaming around and an ID 0 joins, I get the tutorial too.
Reply
#5

Okay, I came up with an idea, searched around but nothing, a SetTimerForPlayer function, is there one? Or a way of making one?


Thanks
Reply
#6

Yes, look at SetTimerEx in the wiki
Reply
#7

SetTimerEx("TIMERNAME",Time,Repeatable,"u",playeri d);
Reply
#8

Quote:
Originally Posted by IntrozeN
SetTimerEx("TIMERNAME",Time,Repeatable,"u",playeri d);
u? i think it is i
Reply
#9

Quote:
Originally Posted by G...m..
Quote:
Originally Posted by IntrozeN
SetTimerEx("TIMERNAME",Time,Repeatable,"u",playeri d);
u? i think it is i
u = User
d/i = Number
Reply
#10

Quote:
Originally Posted by IntrozeN
Quote:
Originally Posted by G...m..
Quote:
Originally Posted by IntrozeN
SetTimerEx("TIMERNAME",Time,Repeatable,"u",playeri d);
u? i think it is i
u = User
d/i = Number
No, u = User in sscanf. But in SetTimerEx i/d = integer & can be used as playerid. There is no "u" in SetTimerEx, so it's SetTimerEx(funcname[], interval, repeating, "i", playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)