[Help]Unknown Command
#1

Hey,

Well my /carcolor command returns an "[ERROR] Unknown Command" when done IG, can anyone find out why?

pawn Код:
dcmd_carcolor(playerid,params[])
{
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x33CCFFFF,"[VT ERROR] You're not in a vehicle.");
  new
    color1,
    color2,
    vid=GetPlayerVehicleID(playerid);
    if(sscanf(params,"ii",color1,color2)) return SendClientMessage(playerid,0x33CCFFFF,"Usage: /carcolor [color 1] [color2]");
  if(vInfo[vid][vOwnerId] != PlayerInfo[playerid][pSQLId]) return SendClientMessage(playerid,0x33CCFFFF,"This vehicle does not belong to you.");
    vInfo[vid][vColor1]=color1;
    vInfo[vid][vColor2]=color2;
    ChangeVehicleColor(vid,color1,color2);
    SaveVehicle(vid);
    return 1;
}
Reply
#2

If you have any other scripts running, make sure it says return 0 at the bottom of their OnPlayerCommandText callbacks.
Reply
#3

Quote:
Originally Posted by Backwardsman97
If you have any other scripts running, make sure it says return 0 at the bottom of their OnPlayerCommandText callbacks.
Did you ever read what he asked for?

Quote:
Originally Posted by ŚĂĞĔ
Well my /carcolor command returns an "[ERROR] Unknown Command" when done IG, can anyone find out why?
What does SaveVehicle function do?
Reply
#4

Quote:
Originally Posted by Μαστερμινδ
Quote:
Originally Posted by Backwardsman97
If you have any other scripts running, make sure it says return 0 at the bottom of their OnPlayerCommandText callbacks.
Did you ever read what he asked for?

Quote:
Originally Posted by ŚĂĞĔ
Well my /carcolor command returns an "[ERROR] Unknown Command" when done IG, can anyone find out why?
What does SaveVehicle function do?
Um...yeah? If you have a filterscript running that has return 1 at the bottom of your OnPlayerCommandText callback, it will return an unknown command for all other scripts when you type in a command. So boom.
Reply
#5

Theres other commands that work out fine though and I have no FS's running that use OnPlayerCommandText.

SaveVehicle just saves the vehicle to the database.
Reply
#6

Quote:
Originally Posted by Backwardsman97
Um...yeah? If you have a filterscript running that has return 1 at the bottom of your OnPlayerCommandText callback, it will return an unknown command for all other scripts when you type in a command. So boom.
uhmm.. maybe so, but he said its just his /carcolor command that returns Unknown command :3

Quote:
Originally Posted by ŚĂĞĔ
SaveVehicle just saves the vehicle to the database.
Make sure it doesnt return anything.. if that helps
Reply
#7

pawn Код:
dcmd_carcolor(playerid,params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0x33CCFFFF,"[VT ERROR] You're not in a vehicle.");
    new color1, color2, vid=GetPlayerVehicleID(playerid);
    print("1");
    if(sscanf(params,"ii",color1,color2)) return SendClientMessage(playerid,0x33CCFFFF,"Usage: /carcolor [color 1] [color2]");
    print("2");
    if(vInfo[vid][vOwnerId] != PlayerInfo[playerid][pSQLId]) return SendClientMessage(playerid,0x33CCFFFF,"This vehicle does not belong to you.");
    vInfo[vid][vColor1]=color1;
    vInfo[vid][vColor2]=color2;
    print("3");
    ChangeVehicleColor(vid,color1,color2);
    print("4");
    SaveVehicle(vid);
    print("5");
    return 1;
}
Use these prints to debug your command in each action. Then look your samp_server.exe window and look which of these prints used. If you see 5 then it means the command works good.
Reply
#8

I can't look in the server window but Theres none of those prints in the server_log atoll.
Reply
#9

Код:
dcmd(carcolor,8,cmdtext);
Make sure the length of the command is 8 characters
Reply
#10

Uhmm it was 7,

Stupid mistake by me XD thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)