Command not working -
Torran - 07.03.2010
I have this code:
pawn Код:
if (!IsPlayerInFlyingVehicle(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, RED, "You need to be a in vehicle to use this command");
Ingame if i type the command it dosent do a thing,
pawn Код:
public IsPlayerInFlyingVehicle(vehicleid)
{
if(GetVehicleModel(592 || 577 || 511 || 512 || 593 || 520 || 553 || 476 || 519 ||
460 || 513 || 548 || 425 || 417 || 487 || 488 || 497 || 563 || 447 || 469)) return 1;
return 0;
}
Re: Command not working -
adsy - 07.03.2010
this is the nos script i use:
Код:
new InvalidNosVehicles[30] =
{
581,523,462,521,463,522,461,448,468,586,
509,481,510,472,473,493,595,484,430,453,
452,446,454,590,569,537,538,539,570,449
};
and
Код:
forward IsPlayerInInvalidNosVehicle(playerid);
public IsPlayerInInvalidNosVehicle(playerid)
{
new carid = GetPlayerVehicleID(playerid);
new carmodel = GetVehicleModel(carid);
for (new i=0; i<sizeof(InvalidNosVehicles); i++) {
if (carmodel == InvalidNosVehicles[i]) return 1;
}
return 0;
}
im guessing you can just modify that
ie change invalidnosvehicle to inflyingvehicle
change the ids in the new bit at the top
call back like so:
Код:
if(!IsPlayerInInvalidNosVehicle(playerid)) {
Re: Command not working -
Carlton - 07.03.2010
You're not using your
GetVehicleModel parameters right. The parameters goes like this:
vehicleid - The vehicle you want to get the model from. The correct coding will be this:
Код:
stock IsplayerInFlyingVehicle(vehicleid)
{
if(GetVehicleModel(vehicleid) == 592 || GetVehicleModel(vehicleid) == 577 || // And you keep going on
}
Re: Command not working -
Gyvo - 07.03.2010
Untested. Hope this works.
Код:
new tmpcar = GetPlayerVehicleID(playerid)
if (!IsPlayerInFlyingVehicle(GetVehicleModel(tmpcar))) SendClientMessage(playerid, RED, "You need to be a in vehicle to use this command");
Код:
public IsPlayerInFlyingVehicle(vehicleid)
{
if(vehicleid == 59 || vehicleid == 577 || vehicleid == 511 || vehicleid == 512 || vehicleid == 593 || vehicleid == 520 || vehicleid == 553 || vehicleid == 476 || vehicleid == 519 || vehicleid == 469 || vehicleid == 460 || vehicleid == 513 || vehicleid == 548 || vehicleid == 425 || vehicleid == 417 || vehicleid == 487 || vehicleid == 488 || vehicleid == 497 || vehicleid == 563 || vehicleid == 447)
{
return true;
}
return false;
}
However if that code is supposed to be in "public OnPlayerEnterVehicle(playerid,vehicleid,ispassenge r)" Then use the following code:
Код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
if (!IsPlayerInFlyingVehicle(GetVehicleModel(vehicleid))) SendClientMessage(playerid, RED, "You need to be a in vehicle to use this command");
return true;
}
Re: Command not working -
adsy - 07.03.2010
anything there help torran?
Re: Command not working -
Torran - 07.03.2010
Ok fixed that, But now if i get in a plane,
Then type /messageme
And im in los santos,
Nothing happens!
pawn Код:
CMD:messageme(playerid, params[])
{
if (!IsPlayerInFlyingVehicle(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, RED, "You need to be a in vehicle to use this command");
else {
SendClientMessage(playerid, RED, "This bit works");
if(IsPlayerInArea(playerid, 151.8124, -2977.858, 3012.892, 268.5911)) {
new string[128];
SendClientMessageToAll(WHITE, "Your in los santos");
}
else if(IsPlayerInArea(playerid, 840.807, 525.5044, 2942.825, 2954.502)) {
new string[128];
SendClientMessageToAll(WHITE, "Your in las venturas");
}
else if(IsPlayerInArea(playerid, -2954.502, -794.0955, -969.2637, 1588.191)) {
new string[128];
SendClientMessageToAll(WHITE, "Your in san fierro";
}
}
return 1;
}
Re: Command not working -
adsy - 07.03.2010
why do you have the new strings?
i dont see the use of them
other than that i cant see a problem with the code although i have never used is player in area
Re: Command not working -
Torran - 07.03.2010
Cause i was going to use a string and i decided not to and i havent removed it,
But does anyone know why?
Re: Command not working -
Torran - 08.03.2010
Anyone?
Re: Command not working -
Gyvo - 08.03.2010
What? Did my post not help you?