Help with(Yes seriously) a oilet system
#1

Hello, i am working on a very basic toilet system, just one with timers and special actions(pissing).
Sow i tried this(Yes i'm new with timers):
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetTimer(toilet, 3600000, true);
        return 1;        
}

forward toilet(playerid);
public toilet(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "Your blather is full, you need to go to the toilet quick!((You got 5 minutes))");
    SetTimer(Hastogo, 300000, false);
}
forward Hastogo(playerid);
public Hastogo(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "You could not hold it in anylonger! You've started to urinate!");
        if(IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_RED, "Quick, get out! You dont want to pee all over de car seat dont you?");
        }
        else
        {
            SetPlayerSpecialAction(playerid, 68);
        }
        return 1;
    }
But now i am getting these errors:
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\RcRP.pwn(2454) : error 076: syntax error in the expression, or invalid function call
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\RcRP.pwn(1371) : error 076: syntax error in the expression, or invalid function call
Specific lines:
pawn Код:
SetTimer(toilet, 3600000, true);
pawn Код:
SetTimer(Hastogo, 300000, false);
Can anyone help me with this?
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetTimer("toilet", 3600000, true);
        return 1;        
}

forward toilet(playerid);
public toilet(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "Your blather is full, you need to go to the toilet quick!((You got 5 minutes))");
    SetTimer("Hastogo", 300000, false);
}
forward Hastogo(playerid);
public Hastogo(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "You could not hold it in anylonger! You've started to urinate!");
        if(IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_RED, "Quick, get out! You dont want to pee all over de car seat dont you?");
        }
        else
        {
            SetPlayerSpecialAction(playerid, 68);
        }
        return 1;
    }
EDIT below:

The name with settimer must have ex: " timerblabla" you missed them. And no problem
Happy to help
Reply
#3

Omg thanks for your quick help!
Now i also understandt timers

PS:
Could you help me with one more thingy?:
When someone is in a car and it gives that message it should also happend that when he gets out, a timer starts of 3 seconds and that after that the peeing action goes on.
Reply
#4

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
Omg thanks for your quick help!
Now i also understandt timers

PS:
Could you help me with one more thingy?:
When someone is in a car and it gives that message it should also happend that when he gets out, a timer starts of 3 seconds and that after that the peeing action goes on.
Use OnPlayerExitVehicle and some variables.

erm , something like:
pawn Код:
new Toilet[MAX_PLAYERS];
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{      if(Toilet[playerid] == 1)
        {
              //do whatyouwant
        }
    return 1;
}
and put
pawn Код:
Toilet[playerid] = 1;
On your timer.
pawn Код:
forward Hastogo(playerid);
public Hastogo(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "You could not hold it in anylonger! You've started to urinate!");
        if(IsPlayerInAnyVehicle(playerid))
        {  Toilet[playerid] = 1;
            SendClientMessage(playerid, COLOR_RED, "Quick, get out! You dont want to pee all over de car seat dont you?");
        }
        else
        {
            SetPlayerSpecialAction(playerid, 68);
        }
        return 1;
    }
Reply
#5

Yes i was thinking of using OnPlayerExitVehicle, thank you!
Reply
#6

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
Yes i was thinking of using OnPlayerExitVehicle, thank you!
I made some examples above ^^
No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)