Help With /Veh
#1

Okay, I need help with my /veh command.

I add it to the list of my commands and I get this.

Код:
C:\Users\Tj\Desktop\SA\Otaku Outbreak\pawno\crp.pwn(7618) : error 017: undefined symbol "IsValidvehicleModel"
C:\Users\Tj\Desktop\SA\Otaku Outbreak\pawno\crp.pwn(7618) : error 017: undefined symbol "model"
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7622) : error 017: undefined symbol "IsValidvehicleModel"
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7629) : error 017: undefined symbol "x"
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7630) : error 017: undefined symbol "x"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
I'm a noobie coder and have no idea how to fix.

Here's my original /veh code.

pawn Код:
if(!strcmp(cmd,"/veh",true))
    {
        if(IsValidvehicleModel(model)) return model>=400&&model<611;
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new car=strval(cmd);
        if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color1=strval(cmd);
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color2=strval(cmd);
        GetPlayerPos(playerid,x,y,z);
        return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
    }
Reply
#2

pawn Код:
if(!strcmp(cmd,"/veh",true))
{
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
  new car=strval(cmd);
  if(strval(cmd) < 400 || strval(cmd) > 600) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
  // You will need to edit that with the correct vehicle model ranges
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
  new color1=strval(cmd);
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
  new color2=strval(cmd);
  GetPlayerPos(playerid,x,y,z);
  return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
}
Reply
#3

well the problem is that you haven't done the bit that checks the model right, here it is:

also put this under OnPlayerCommandText:
pawn Код:
new tmp[128];
pawn Код:
if(strcmp(cmd,"/veh",true)==0)
{
    new veh,c1,c2;
    new Float:X, Float:Y, Float:Z;
    tmp=strtok(cmdtext,idx);
    if(strlen(tmp)==0) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [ModleID] [color 1] [color 2]");
    veh=strval(tmp);
    if(veh>611||veh<400)return SendClientMessage(playerid,COLOR_GREY,"Invalid Modle ID.");
    tmp=strtok(cmdtext,idx);
    if(strlen(tmp)==0) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [ModleID] [color 1] [color 2]");
    c1=strval(tmp);
    tmp=strtok(cmdtext,idx);
    if(strlen(tmp)==0) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [ModleID] [color 1] [color 2]");
    c2=strval(tmp);
    GetPlayerPos(playerid,x,y,z);
    return CreateVehicle(veh,X,Y,Z,0,c1, c2,60000);
}
Reply
#4

Quote:
Originally Posted by JeNkStAX
pawn Код:
if(!strcmp(cmd,"/veh",true))
{
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
  new car=strval(cmd);
  if(strval(cmd) < 400 || strval(cmd) > 600) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
  // You will need to edit that with the correct vehicle model ranges
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
  new color1=strval(cmd);
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
  new color2=strval(cmd);
  GetPlayerPos(playerid,x,y,z);
  return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
}
With your code I get;

Код:
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7616) : warning 217: loose indentation
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7629) : error 017: undefined symbol "x"
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7630) : error 017: undefined symbol "x"
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7633) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

Okay, I got rid of the 2 warning, but now it's the 2 errors, can anyone help?!?!?!

pawn Код:
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7629) : error 017: undefined symbol "x"
C:\Users\Tj\Desktop\SA\123\pawno\crp.pwn(7630) : error 017: undefined symbol "x"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

Bump...I need help quickly.
Reply
#7

BUMP!!!!!!!!!!!!!!!!!!!!!!!!! I NEED HELP ASAP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reply
#8

Bumping it repeatedly won't get you help.
Reply
#9

It wasn't repeatedly, now if you can't help me, get the hell off my thread.
Reply
#10

Quote:
Originally Posted by TehSeren
It wasn't repeatedly, now if you can't help me, get the hell off my thread.
I can help you, but with an attitude like that I don't think I will.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)