ispassenger boolean?
#1

is the ispassenger variable from onplayer enter/exit vehicle a boolean? if so, y dont this work? CODE:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == ccar)
    {
        if(!ispassenger = true)
        {
            new string[64], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has taken the chasecar!", name);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid == ccar)
    {
        if(!ispassenger = true)
        {
            new string[64], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has left the chasecar!", name);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
    return 1;
}
Reply
#2

"ispassenger 0 if entering as driver. 1 if entering as passenger."
Reply
#3

Quote:
Originally Posted by sciman001
Посмотреть сообщение
is the ispassenger variable from onplayer enter/exit vehicle a boolean? if so, y dont this work? CODE:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == ccar)
    {
        if(!ispassenger = true)
        {
            new string[64], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has taken the chasecar!", name);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid == ccar)
    {
        if(!ispassenger = true)
        {
            new string[64], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has left the chasecar!", name);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
    return 1;
}
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == ccar)
    {
        if(!ispassenger)
        {
            new string[64], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has taken the chasecar!", name);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid == ccar)
    {
        if(!ispassenger)
        {
            new string[64], name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has left the chasecar!", name);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by mprofitt
Посмотреть сообщение
"ispassenger 0 if entering as driver. 1 if entering as passenger."
if(! means "if(isnot" so that part of his script is correct.
Reply
#5

how do i use KillTimer(timerid);
Reply
#6

pawn Код:
// TOP of your script
new timername;

// When you want to start your timer
timername = SetTimer(....


// When you want to kill timer
KillTimer(timername);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)