PDA

View Full Version : Public only id 0????


falor
03/03/2012, 10:36 PM
Hey guys,

i make a public function, but it works only for id 0, and it does nothing for other ids any idea?

new Tutonumber[MAX_PLAYERS];
forward tutorial(playerid);

Onplayerspawn i set :
SetTimer("Tutorial", 25000, false);

And the function :

public Tutorial(playerid)
{
new pname[24], string[128];
GetPlayerName(playerid, pname, 24);
if(Tutonumber[playerid] == 0)
{
format(string, 128, "-------------------XXXXXXXX %s----------------------", pname);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, 128, "XXXXXXXXXXXXXXXXXXX");
SendClientMessage(playerid,COLOR_WHITE, string);
format(string, 128, "XXXXXXXXXXXXXXXXXXXXXXX");
SendClientMessage(playerid,COLOR_WHITE, string);
format(string, 128, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
SendClientMessage(playerid,COLOR_WHITE, string);
format(string, 128, "----------------------------------------------------------------------------");
SendClientMessage(playerid,COLOR_YELLOW, string);
SetTimer("Tutorial", 19000, false);
Tutonumber[playerid] = 1;
}
else if(Tutonumber[playerid] == 1)
{
format(string, 128, "---------------------------XXXXXXXXXXXX----------------------------");
SendClientMessage(playerid,COLOR_YELLOW, string);
format(string, 128, "----------------------------------------------------------------------------");
SendClientMessage(playerid,COLOR_YELLOW, string);
SetTimer("Tutorial", 25000, false);
Tutonumber[playerid] = 2;
}
else if(Tutonumber[playerid] == 2)
{
format(string, 128, "---------------------------XXXXXXXXXXXXXXXXX--------------------------------");
SendClientMessage(playerid,COLOR_YELLOW, string);
format(string, 128, "----------------------------------------------------------------------------");
SendClientMessage(playerid,COLOR_YELLOW, string);
SetTimer("Tutorial", 25000, false);
Tutonumber[playerid] = 3;
}
else if(Tutonumber[playerid] == 3)
{
SendClientMessage(playerid,COLOR_GREY, string);
format(string, 128, "XXXXXXXXXXXXXXXX%s.", pname);
SetTimer("OnPlayerSpawn", 100, false);
}
return 1;
}

And moreover, i set : SetPlayerColor(playerid, COLOR_WHITE); in OnPlayerConnect

But i seems that players got random name color...


Who can help me please? :'(

Thanks

Nuke547
03/03/2012, 10:38 PM
For the onplayerspawn, use this:


SetTimerEx("Tutorial", 2500, true, "d", playerid);

falor
03/03/2012, 10:46 PM
thanks, i'll try!

It shouldn't be "false"?

And for the colors any idea? :(

Nuke547
03/03/2012, 10:57 PM
Nope, it should be true, it wont work with false, and for the colors, are you sure the color isnt being set anywhere else? If not, onplayerconnnect do SetPlayerColor(playerid, 0xFFFFFFFF);

Nuke547
03/03/2012, 11:04 PM
Nope, it should be true, it wont work with false, and for the colors, are you sure the color isnt being set anywhere else? If not, onplayerconnnect do SetPlayerColor(playerid, 0xFFFFFFFF);

falor
03/03/2012, 11:08 PM
I used false and it works!
Thanks for your help

+rep for you!!

btw : for the color idk how to solve that

Nuke547
03/03/2012, 11:10 PM
The color is acting wierd for you. Sorry. I dont know why its doing that. Maybe put it onplayerspawn as well?

falor
03/03/2012, 11:29 PM
YES!

Well done, and now i can see who is logged and who isn't! Thanks dude