Vehicle name from ID Error
#1

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
Reply
#2

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

can you fix it?
Reply
#4

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

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;
}
Reply
#6

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;
}
Reply
#7

The error still comes from this line:

GetVehicleModelIDFromName(vehicle);


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

Post that function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)