[Help] Subcommands
#1

When i type /buyvehicle it shows ok but when i try to type /buyvehicle bmx or /buyvehicle buffalo it won't work , can some one help me please
Quote:

if(!strcmp(cmdtext, "/buyvehicle", true)) // By Ellis
{
new x_nr[64];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /buyvehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available vehicles: bmx (20000$), buffalo (500000$)");
return 1;
}
if(strcmp(x_nr,"bmx",true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "BMX");
}
else if(strcmp(x_nr,"buffalo",true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "buffalo");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /buyvehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available vehicles: bmx (20000$), buffalo (500000$)");
}
return 1;
}

Reply
#2

lol that's why , u dont even use CreateVehicle function

https://sampwiki.blast.hk/wiki/CreateVehicle
https://sampwiki.blast.hk/wiki/GetPlayerPos
Reply
#3

Quote:
Originally Posted by Etch ❽ H
I don't wanna you to script me that , this was example of the command
It doesn't send me message BMX when i type /buyvehicle bmx
Reply
#4

pawn Код:
if(!strcmp(cmd, "/buyvehicle", true)) // By Ellis
    {
      new x_nr[256];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
        {
          SendClientMessage(playerid, COLOR_WHITE, "HINT: /buyvehicle [name]");
          SendClientMessage(playerid, COLOR_WHITE, "Available vehicles: bmx (20000$), buffalo (500000$)");
          return 1;
        }
        new vehicle=strval(x_nr);
      if(strcmp(vehicle,"bmx",true) == 0)
            {
            SendClientMessage(playerid, COLOR_WHITE, "BMX");
            }
      else if(strcmp(vehicle,"buffalo",true) == 0)
            {
            SendClientMessage(playerid, COLOR_WHITE, "buffalo");
            }
        else
            {
              SendClientMessage(playerid, COLOR_WHITE, "HINT: /buyvehicle [name]");
            SendClientMessage(playerid, COLOR_WHITE, "Available vehicles: bmx (20000$), buffalo (500000$)");
            }
      return 1;
    }
[/quote]
Reply
#5

Quote:
Originally Posted by CAR
pawn Код:
if(!strcmp(cmd, "/buyvehicle", true)) // By Ellis
    {
      new x_nr[256];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
        {
          SendClientMessage(playerid, COLOR_WHITE, "HINT: /buyvehicle [name]");
          SendClientMessage(playerid, COLOR_WHITE, "Available vehicles: bmx (20000$), buffalo (500000$)");
          return 1;
        }
        [b]new vehicle=strval(x_nr);[/b]
      [b]if(strcmp(vehicle,"bmx",true) == 0)[/b]
            {
            SendClientMessage(playerid, COLOR_WHITE, "BMX");
            }
      [b]else if(strcmp(vehicle,"buffalo",true) == 0)[/b]
            {
            SendClientMessage(playerid, COLOR_WHITE, "buffalo");
            }
        else
            {
              SendClientMessage(playerid, COLOR_WHITE, "HINT: /buyvehicle [name]");
            SendClientMessage(playerid, COLOR_WHITE, "Available vehicles: bmx (20000$), buffalo (500000$)");
            }
      return 1;
    }
Quote:

C:\DOCUME~1\Ivan\Desktop\GTARP2\GTARP\GAMEMO~1\gta rp.pwn(16860) : error 035: argument type mismatch (argument 1)
C:\DOCUME~1\Ivan\Desktop\GTARP2\GTARP\GAMEMO~1\gta rp.pwn(16864) : error 035: argument type mismatch (argument 1)
C:\DOCUME~1\Ivan\Desktop\GTARP2\GTARP\GAMEMO~1\gta rp.pwn(16859) : warning 204: symbol is assigned a value that is never used: "vehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)