Why dont recognize the vehicule SOLVED - 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: Why dont recognize the vehicule SOLVED (
/showthread.php?tid=97390)
Why dont recognize the vehicule SOLVED -
[SOB]Chris - 14.09.2009
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new moto[10];
moto[0]=veid, moto[1]=vehid, moto[2]=vehid, moto[3]=vehid; //where vehid is a vehicule number.
for (new i=0; i<4;i++)
{
if (IsPlayerInVehicle(playerid,moto[i]) && estado == PLAYER_STATE_DRIVER)
{
if (newkeys & (KEY_FIRE | KEY_ACTION))
{
pushiment(playerid);
}
}
compile good and i think must work but when i in a moto and the moto are in one array and shoot nothing happend D=, why? what revise IsPlayerInVehicle(playerid,moto[i]) and if i use IsPlayerInAnyVehicle(playerid); work the key detection =/ but i want only work with motos
---------------------------------------------------------------------------------------------------
EDIT
I Solved the problem is IsPlayerInVehicle return o check the ID not the model, how i solved, whit getvehiculemodel =D
Re: Why dont recognize the vehicule -
Adil - 14.09.2009
Quote:
|
Originally Posted by [SOB
Chris ]
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new moto[10];
moto[0]=veid, moto[1]=vehid, moto[2]=vehid, moto[3]=vehid; //where vehid is a vehicule number.
for (new i=0; i<4;i++)
{
if (IsPlayerInVehicle(playerid,moto[i]) && estado == PLAYER_STATE_DRIVER)
{
if (newkeys & (KEY_FIRE | KEY_ACTION))
{
pushiment(playerid);
}
}
compile good and i think must work but when i in a moto and the moto are in one array and shoot nothing happend D=, why? what revise IsPlayerInVehicle(playerid,moto[i]) and if i use IsPlayerInAnyVehicle(playerid); work the key detection =/ but i want only work with motos
}
|
Quote:
|
Originally Posted by [SOB
Chris ]
moto[0]=veid
|
Maybe this is wrong ?
Re: Why dont recognize the vehicule -
[SOB]Chris - 14.09.2009
Quote:
|
Originally Posted by Adil_Rahoo
Quote:
|
Originally Posted by [SOB
Chris ]
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new moto[10];
moto[0]=veid, moto[1]=vehid, moto[2]=vehid, moto[3]=vehid; //where vehid is a vehicule number.
for (new i=0; i<4;i++)
{
if (IsPlayerInVehicle(playerid,moto[i]) && estado == PLAYER_STATE_DRIVER)
{
if (newkeys & (KEY_FIRE | KEY_ACTION))
{
pushiment(playerid);
}
}
compile good and i think must work but when i in a moto and the moto are in one array and shoot nothing happend D=, why? what revise IsPlayerInVehicle(playerid,moto[i]) and if i use IsPlayerInAnyVehicle(playerid); work the key detection =/ but i want only work with motos
}
|
Quote:
|
Originally Posted by [SOB
Chris ]
moto[0]=veid
|
Maybe this is wrong ?
|
//where vehid is a vehicule number.
vehid in the real script is 522 581 ...etc