Vehicle id getter - 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: Vehicle id getter (
/showthread.php?tid=189155)
Vehicle id getter -
sansko - 10.11.2010
Hey Everybody
I'm trying to make a vehicle id getter so i know in wich vehicle i am
(for spectating purposes)
I now have this
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Vid", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerVehicleID(playerid);
SendClientMessage(playerid,0x00FF00,"your vehicle id is: %");
}
else
{
SendClientMessage(playerid,0x0000FFFF,"You are not in a vehicle");
}
return 1;
}
return 0;
}
but its not working
it wanna know wich this line "your vehicle id is: %" has to be
Thanks in advance
Re: Vehicle id getter -
ExeC - 10.11.2010
You could try this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Vid", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[80];
GetPlayerVehicleID(playerid, string, sizeof(string));
format(string,sizeof(string),"Your vehicle id is: %i", string);
SendClientMessage(playerid, 0x00FF08FF, string);
}
else
{
SendClientMessage(playerid,0x0000FFFF,"You are not in a vehicle");
}
return 1;
}
return 0;
}
Not sure if it works.
Re: Vehicle id getter -
sansko - 10.11.2010
its better but now i get this errors
Код:
C:\Users\User\Desktop\files\sa-mp\own\filterscripts\vid getter.pwn(12) : warning 202: number of arguments does not match definition
C:\Users\User\Desktop\files\sa-mp\own\filterscripts\vid getter.pwn(12) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Vid", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[80];
GetPlayerVehicleID(playerid, string, sizeof(string)); //this is line 12
format(string,sizeof(string),"Your vehicle id is: %d", string);
SendClientMessage(playerid, 0x00FF08FF, string);
}
else
{
SendClientMessage(playerid,0x0000FFFF,"You are not in a vehicle");
}
return 1;
}
return 0;
}
Re: Vehicle id getter -
ExeC - 10.11.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Vid", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[24];
format(string, 24, "Your vehicle id is:: %i");
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
else
{
SendClientMessage(playerid,0x0000FFFF,"You are not in a vehicle");
}
return 1;
}
return 0;
}
Maybe...
Re: Vehicle id getter -
sansko - 10.11.2010
not working
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Vid", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[24];
format(string, 24, "Your vehicle id is:: %i");
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
else
{
SendClientMessage(playerid,0x0000FFFF,"You are not in a vehicle");
}
return 1;
}
return 0;
}
it says in every vehicle "Your vehicle id is:: 47"
Re: Vehicle id getter -
BMUK - 10.11.2010
format(string, 24, "Your vehicle id is:: %d", GetPlayerVehicleID(playerid));