SA-MP Forums Archive
Vehicle name from ID Error - 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 name from ID Error (/showthread.php?tid=74013)



Vehicle name from ID Error - Robbin237 - 19.04.2009

i want that if i type /accar cheetah that a cheetah will spawn..
now im using this:

http://forum.sa-mp.com/index.php?topic=62210.0

this is my code:

pawn Код:
dcmd_test(playerid,params[])
{

    new vehicle;
   
    if(sscanf(params, "s", vehicle))
    {
      SendClientMessage(playerid, COLOR_RED, "No Vehicle Name Given");
    } else {
      GetVehicleModelIDFromName(vehicle);
    }
   
    SendClientMessageToAll(COLOR_LIGHTBLUE, aVehicleNames[vehicle - 400]);
    return 1;
}
And this error:

pawn Код:
E:\_Spellen\bkp\filterscripts\dcadmin.pwn(591) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Please help me,
Thnx


Re: Vehicle name from ID Error - Rks25 - 19.04.2009

that error comes from SCM line right?
Use format().


Re: Vehicle name from ID Error - Robbin237 - 19.04.2009

can you fix it?


Re: Vehicle name from ID Error - Rks25 - 19.04.2009

Replace that with this.
pawn Код:
new str[128];
format(str, sizeof(str), "%s",aVehicleNames[vehicle - 400]);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);



Re: Vehicle name from ID Error - Robbin237 - 19.04.2009

EDIT: Note, that the error line is this:
GetVehicleModelIDFromName(vehicle);

That would be this right?

pawn Код:
dcmd_test(playerid,params[])
{
new str[128];
format(str, sizeof(str), "%s",aVehicleNames[vehicle - 400]);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);

return 1;
}



Re: Vehicle name from ID Error - Rks25 - 19.04.2009

pawn Код:
dcmd_test(playerid,params[])
{
  new vehicle, str[128];

  if(sscanf(params, "s", vehicle))
  {
    SendClientMessage(playerid, COLOR_RED, "No Vehicle Name Given");
  } else {
    GetVehicleModelIDFromName(vehicle);
  }

  format(str, sizeof(str), "%s",aVehicleNames[vehicle - 400]);
  SendClientMessageToAll(COLOR_LIGHTBLUE, str);

  return 1;
}



Re: Vehicle name from ID Error - Robbin237 - 19.04.2009

The error still comes from this line:

GetVehicleModelIDFromName(vehicle);


E:\_Spellen\bkp\filterscripts\dcadmin.pwn(591) : error 035: argument type mismatch (argument 1)



Re: Vehicle name from ID Error - Rks25 - 19.04.2009

Post that function.