Why dont recognize the vehicule SOLVED
#1

Код:
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
Reply
#2

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)