ispassenger boolean? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ispassenger boolean? (
/showthread.php?tid=244593)
ispassenger boolean? -
sciman001 - 27.03.2011
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;
}
Re: ispassenger boolean? -
mprofitt - 27.03.2011
"ispassenger 0 if entering as driver. 1 if entering as passenger."
Re: ispassenger boolean? -
mprofitt - 27.03.2011
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;
}
Re: ispassenger boolean? -
Mike Garber - 27.03.2011
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.
Re: ispassenger boolean? -
sciman001 - 27.03.2011
how do i use KillTimer(timerid);
Re: ispassenger boolean? -
Mike Garber - 27.03.2011
pawn Код:
// TOP of your script
new timername;
// When you want to start your timer
timername = SetTimer(....
// When you want to kill timer
KillTimer(timername);