Vehicle problem - 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)
+--- Thread: Vehicle problem (
/showthread.php?tid=427724)
Vehicle problem -
[..MonTaNa..] - 02.04.2013
.....
Re: Vehicle problem -
Scrillex - 02.04.2013
Please correct your question.. Because I dont get it what you really want!
Re: Vehicle problem -
Private200 - 02.04.2013
pawn Код:
CMD:veh(playerid, params[])
{
new carName[100];
if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
if(sscanf(params, "s[100]", carName)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /veh (Vehicle Name)");
if(BlockVeh == 1) return SendClientMessage(playerid, COLOR_RED, "This Command Is DISABLED.");
else if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Are Already In A Vehicle.");
else if(ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle Model.");
else
{
new Float:pPos[4], vid;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1.00, pPos[3], 0, 0, 60);
PutPlayerInVehicle(playerid, vid, 0);
}
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 441 || GetVehicleModel(vehicleid) == 464 || GetVehicleModel(vehicleid) == 465 ||
GetVehicleModel(vehicleid) == 501 || GetVehicleModel(vehicleid) == 564 || GetVehicleModel(vehicleid) == 594 || GetVehicleModel(vehicleid) == 447 || GetVehicleModel(vehicleid) == 449 || GetVehicleModel(vehicleid) == 537 || GetVehicleModel(vehicleid) == 538 ||
GetVehicleModel(vehicleid) == 539 || GetVehicleModel(vehicleid) == 577 || GetVehicleModel(vehicleid) == 592 || GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 604 || GetVehicleModel(vehicleid) == 605)
}
return 1;
}
I ain't sure if this is what you really want.
Re: Vehicle problem -
park4bmx - 02.04.2013
EDIT
the loop wasn't currect!
Also u migh get a warning for the index of "InvalidCars"
pawn Код:
new InvalideCars[5][] = {
{432},
{520},
{425},
{441},
{464},
//keep on adding the ids
};
//vehicled I'd needs to be the variable of the current modelid of the players vehicle
for(new i=0; i <sizeof InvalideCars; i++)
{
if(vehicleid == InvalideCars[i]) return SendClientMessage(playerid,COLOR_WHITE,"This Vehicle Is "RED"Not "WHITE"Allowed!");
}
It needs modifying, i done it with my phone!
Re: Vehicle problem -
[..MonTaNa..] - 02.04.2013
~~~~~~
Re: Vehicle problem -
[..MonTaNa..] - 03.04.2013
~~~~~~
Re: Vehicle problem -
park4bmx - 03.04.2013
I got the check wrong, but my previous pos. is edited!
I'm not sure if there should be 1 more index