Vehicle ID's - 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 ID's (
/showthread.php?tid=372484)
Vehicle ID's -
Justin Reif - 26.08.2012
I need help like a command, /getvehicleid which shows the ID of the vehivle which the person is currently on
Also when you enter a vehicle, a client message will show up
Quote:
You entered [vehicle name and id].
|
Sorry if this is the wrong section
AW: Vehicle ID's -
dalkgamler - 26.08.2012
pawn Код:
Public OnPlayerEnterVehicle(playerid,vehicleid)
{
SendClientMessage(playerid,vehicleid);
Return 1;
}
Try this
Re: Vehicle ID's -
Dan. - 26.08.2012
pawn Код:
CMD:vehid(playerid, params[])
{
new string[16];
format(string, sizeof string, "%d", GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, string);
return 1;
}
Re: Vehicle ID's -
Justin Reif - 26.08.2012
Can there also be a command for admins to view others' vehicle iD?
Re: Vehicle ID's -
DeadLy™ - 26.08.2012
Yes, You can see in your samp server folders, In Vehicles
Re: Vehicle ID's -
Dan. - 26.08.2012
You must have sscanf2 for this code to work also:
pawn Код:
CMD:avehid(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 0)
{
new targetid, string[16];
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "USAGE: /avehid [playerid/partofname]");
{
if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid, -1, "That player isn't in a vehicle!");
format(string, sizeof string, "%d", GetPlayerVehicleID(targetid));
SendClientMessage(playerid, -1, string);
}
}
else return SendClientMessage(playerid, -1, "You must be an admin to use this command!");
return 1;
}
Re: Vehicle ID's -
Justin Reif - 26.08.2012
Oh, thanks dude. I am a newbie to scripting -.-
If I want to use it for Ladmin, I just have to edit
Код:
if(PlayerInfo[playerid][pAdmin] > 0)
to
Код:
if(PlayerInfo[playerid][Level] >= 4) {
Re: Vehicle ID's -
Dan. - 26.08.2012
No, you don't need that unnecessary bracket in the end of the line, because a new bracket is already starting on the next line, just do it like this:
pawn Код:
if(PlayerInfo[playerid][Level] >= 4)
Re: Vehicle ID's -
Justin Reif - 26.08.2012
K, ty