What's the problem in this CMD?
#1

I convert an some cmd into zcmd.

This is old (also i add implented other way to work)

pawn Код:
if(strcmp(cmd, "/produkte", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] != 30)
            {
                SendClientMessage(playerid, COLOR_WHITE,"[{FFD200}INFO:{FAFAFA}] Ti nisi vozac za {00B9FF}Produkte{FAFAFA}.");
                return 1;
            }
            if(PlayerToPoint(30.0,playerid,2417.39990234,-2475.00000000,13.89999962) || PlayerToPoint(25.0,playerid,2412.39990234,-2460.19995117,13.69999981))
            {
                SendClientMessage(playerid, COLOR_WHITE,"[{FFD200}INFO:{FAFAFA}] Nisi na mesto za {00B9FF}Poslu{FAFAFA}.");
                return 1;
            }
            new prodkola = GetPlayerVehicleID(playerid);
            if(IsAProdCar(prodkola))
             {
            SetPlayerCheckpoint(playerid, Ribados1, 3.0);
            SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Tvoju Poslu je da dostavis produkte u magacinu.");
            return 1;
        }
    }
  }
The converted looks like this, but whats the problem because the first think when i try /produkti say "Unkown command"

Converted To this:

pawn Код:
CMD:produkte(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Moras biti logovan da bi koristio ovu komandu.");
    if(PlayerInfo[playerid][pJob] != JOB_PRODUKTE && PlayerInfo[playerid][pVIPJob] != JOB_PRODUKTE) return SendClientMessage(playerid, COLOR_GREY, "{FAFAFA}[{FFD200}INFO:{FAFAFA}] Ti nisi vozac za {00B9FF}Produkte{FAFAFA}.");
    if(ProduCar(prodCar))  return SendClientMessage(playerid, COLOR_GREY, "Moras biti u vozilo da bi koristio ovu komandu.");
    ProdJob[playerid] = 1;
    SetPlayerCheckpoint(playerid,Produkti1,11);
    SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Tvoju Poslu je da dostavis produkte u magacinu.");
    return 1;
}
I convert then like this, but i get same. The other cmd looks like this for other job it work but this one not work?

pawn Код:
CMD:produkti(playerid, params[])
{
    if(IsPlayerLoggedIn(playerid))
        {
           if(PlayerInfo[playerid][pJob] != JOB_PRODUKTE && PlayerInfo[playerid][pVIPJob] != JOB_PRODUKTE)
            {
                SendClientMessage(playerid, COLOR_WHITE,"[{FFD200}INFO:{FAFAFA}] Ti nisi vozac za {00B9FF}Petrol{FAFAFA}.");
                return 1;
            }
            if(ProduCar(prodCar))
            {
            ProdJob[playerid] = 1;
            SetPlayerCheckpoint(playerid,Produkti1,11);
            SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Tvoju Poslu je da dostavis produkte u magacinu.");
          }
      }
     return 1;
  }
Reply
#2

Try this..

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

   if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not logged in");
   if(PlayerInfo[playerid][pJob] != JOB_PRODUKTE && PlayerInfo[playerid][pVIPJob] != JOB_PRODUKTE)
   {
         //your code
   }
   if(ProduCar(prodCar))
  {
         //your code
  }
  return 1;
}
Reply
#3

Quote:
Originally Posted by Zamora
Посмотреть сообщение
Try this..

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

   if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not logged in");
   if(PlayerInfo[playerid][pJob] != JOB_PRODUKTE && PlayerInfo[playerid][pVIPJob] != JOB_PRODUKTE)
   {
         //your code
   }
   if(ProduCar(prodCar))
  {
         //your code
  }
  return 1;
}
Same, "Unknown command"....
Reply
#4

Try debugging.
pawn Код:
CMD:produkte(playerid, params[])
{
    print("1");
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Moras biti logovan da bi koristio ovu komandu.");
    print("2");
    if(PlayerInfo[playerid][pJob] != JOB_PRODUKTE && PlayerInfo[playerid][pVIPJob] != JOB_PRODUKTE) return SendClientMessage(playerid, COLOR_GREY, "{FAFAFA}[{FFD200}INFO:{FAFAFA}] Ti nisi vozac za {00B9FF}Produkte{FAFAFA}.");
    print("3");
    if(ProduCar(prodCar))  return SendClientMessage(playerid, COLOR_GREY, "Moras biti u vozilo da bi koristio ovu komandu.");
    ProdJob[playerid] = 1;
    print("4");
    SetPlayerCheckpoint(playerid,Produkti1,11);
    print("5");
    SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Tvoju Poslu je da dostavis produkte u magacinu.");
    print("6");
    return 1;
}
Compile this, and execute the command in game. Now check the console, and check the code after the last number that appeared.
Reply
#5

I change it and fixed it into this:
Код:
CMD:loadprodukte(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Moras biti logovan da bi koristio ovu komandu.");
   	if(PlayerInfo[playerid][pJob] != JOB_PRODUKTE && PlayerInfo[playerid][pVIPJob] != JOB_PRODUKTE) return SendClientMessage(playerid, COLOR_GREY, "Ti nisi vozac HotDoga.");
    new veh;
    veh = GetPlayerVehicleID(playerid);
    if(!ProduCar(veh)) return SendClientMessage(playerid, COLOR_GREY, "Moras biti u vozilo da bi koristeo ovu komandu.");
   	ProdJob[playerid] = 1;
    SetPlayerCheckpoint(playerid,Produkti1,11);
    SendClientMessage(playerid,COLOR_GREY,"* Pratite crvene markere!");
	return 1;
}
It work only if you in the car if you out of the car it says "Unkown"...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)