PDA

View Full Version : Getting Server Unknown Command


bare380
15/04/2014, 05:49 PM
why do i get Server Unknown command on enterin the Slot Number.
if(strcmp(cmd, "/sellcar", true) == 0)
{
new car1 = PlayerInfo[playerid][CarLinkID];
new car2 = PlayerInfo[playerid][Car2LinkID];
if(car1 == 0 && car2 == 0) return SendClientMessage(playerid, COLOR_GREY, " You do not own a car.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellcar [playerid/PartOfName] [price] [Vehicle Number(1 - 2)]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellcar [playerid/PartOfName] [price] [Vehicle Number(1 - 2)]");
return 1;
}
new price = strvalEx(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellcar [playerid/PartOfName] [price] [Vehicle Number(1 - 2)]");
return 1;
}
new stuff = strvalEx(tmp);
if(price < 50000 || price > 15000000) return SendClientMessage(playerid, COLOR_GREY, " Price cannot be lower than $50,000 or higher than $15,000,000.");
if(playerid == giveplayerid)
{
return SendClientMessage(playerid, COLOR_GREY, " You cannot sell yourself a car.");
}
if(PlayerInfo[giveplayerid][CarLinkID] != 0 && PlayerInfo[giveplayerid][Car2LinkID] != 0)
{
return SendClientMessage(playerid, COLOR_GREY, " That player already owns two cars.");
}
if(!ProxDetectorS(10.0, playerid, giveplayerid))
{
return SendClientMessage(playerid, COLOR_GREY, " That player is not near you.");
}
if( stuff == 1 )
{
sellcarvehicle = PlayerInfo[playerid][CarLinkID];
}
else if( stuff == 2 )
{
sellcarvehicle = PlayerInfo[playerid][Car2LinkID];
}
format(string, sizeof(string), "* You offered %s to buy your car (%s) for $%d.",RemoveUnderScore(giveplayerid),vehName[sellcarvehicle-400],price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s wants to sell you a car (%s) for $%d, (type /accept car) to accept.",RemoveUnderScore(playerid),vehName[sellcarvehicle-400],price);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s hands %s the contract to their car.",RemoveUnderScore(playerid),RemoveUnderScore(givep layerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
CarOffer[giveplayerid] = playerid;
CarPrice[giveplayerid] = price;
CarID[giveplayerid] = sellcarvehicle;
CarSlot[giveplayerid] = stuff;
return 1;
}

AroseKhanNiazi
15/04/2014, 05:57 PM
try zcmd or dcmd it's old

SmithyComp
15/04/2014, 06:00 PM
As AroseKhanNaizi suggested, try upgrading to a more stable command processing system, like ZCMD.

Here's the ZCMD thread - http://forum.sa-mp.com/showthread.php?t=91354

bare380
15/04/2014, 06:06 PM
All the commands are like this. i dunno how to convert them it's too long...
can anyone help me ?

bare380
16/04/2014, 11:39 AM
anyone ??