Timer text showing up twice HELP
#1

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;
}
Reply
#2

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;
}
Reply
#3

lol dude wtf? its not a command to return a message that his not an admin lmao
Reply
#4

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(playeridCOLOR_WHITE"You cant have 1 life point without asking the owner!");
            
TogglePlayerControllable(playerid1);
        }
        else if(
pInfo[playerid][pAdmin] == 0) return SendClientMessage(playeridCOLOR_WHITE"You cant have 1 life point without asking the owner!");
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"Loaded! you can play now.");
    }
    return 
1;

Reply
#5

Lol seriously dude if you dont know what im talking about dont help me thanks for trying tho.
Reply
#6

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?
Reply
#7

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.
Reply
#8

Well then, check if you didn't called the timer two times, because the code is correct.
Reply
#9

someone helpme?
Reply
#10

We can't help you because the code is correct. Something else is wrong, and you have to find out what it is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)