Timer text showing up twice HELP -
Danialdano - 09.01.2014
The 'Checking if you got one life point' and all the other sendclientmessages in the timer shows up twice and i set the timer under onplayerspawn, whats the problem?
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "Checking if you got one life point..");
SetTimerEx("Life", 10000, 0, "i", playerid);
pawn Код:
forward Life(playerid);
public Life(playerid)
{
if(pInfo[playerid][pLife] == 1)
{
if(pInfo[playerid][pAdmin])
{
SendClientMessage(playerid, COLOR_WHITE, "You cant have 1 life point without asking the owner!");
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You have 1 life point which has been removed from the script please tell an admin to remove it.");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Loaded! you can play now.");
}
return 1;
}
Re: Timer text showing up twice HELP -
offon - 09.01.2014
I'd do this:
Код:
forward Life(playerid);
public Life(playerid)
{
if(pInfo[playerid][pLife] == 1)
{
if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "You are not an Admin!");
else
{
SendClientMessage(playerid, COLOR_WHITE, "You cant have 1 life point without asking the owner!");
TogglePlayerControllable(playerid, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Loaded! you can play now.");
}
return 1;
}
Re: Timer text showing up twice HELP -
Danialdano - 09.01.2014
lol dude wtf? its not a command to return a message that his not an admin lmao
Re: Timer text showing up twice HELP -
offon - 09.01.2014
Oh, I just noticed that now. Sorry, my mistake.
EDIT:
PHP код:
forward Life(playerid);
public Life(playerid)
{
if(pInfo[playerid][pLife] == 1)
{
if(pInfo[playerid][pAdmin] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You cant have 1 life point without asking the owner!");
TogglePlayerControllable(playerid, 1);
}
else if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You cant have 1 life point without asking the owner!");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Loaded! you can play now.");
}
return 1;
}
Re: Timer text showing up twice HELP -
Danialdano - 09.01.2014
Lol seriously dude if you dont know what im talking about dont help me thanks for trying tho.
Re: Timer text showing up twice HELP -
offon - 09.01.2014
What's wrong then?
PHP код:
if(pInfo[playerid][pAdmin])
is the same as,
PHP код:
if(pInfo[playerid][pAdmin] == 1)
however I've corrected it a bit.
And on else you check if the player isn't an admin, right? Did you even try the code?
Re: Timer text showing up twice HELP -
Danialdano - 09.01.2014
pawn Код:
if(pInfo[playerid][pAdmin] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You cant have 1 life point without asking the owner!");
TogglePlayerControllable(playerid, 1);
}
else if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You cant have 1 life point without asking the owner!");
You kidding me? its the same shit plus that thats not the only problem i have even if it works what about when the player spawns it sends him ''Checking if you got one life point..' twice.
Re: Timer text showing up twice HELP -
offon - 09.01.2014
Well then, check if you didn't called the timer two times, because the code is correct.
Re: Timer text showing up twice HELP -
Danialdano - 09.01.2014
someone helpme?
Re: Timer text showing up twice HELP -
offon - 09.01.2014
We can't help you because the code is correct. Something else is wrong, and you have to find out what it is.