05.07.2013, 14:29
Why this gives me unknown command?
pawn Код:
new cmd[30], params[30];
sscanf(cmdtext, "ss", cmd, params);
if(!strcmp(cmd, "/loadlogs"))
{
new cID = GetPlayerVehicleID(playerid);
if(CarInfo[cID][logloaded] == 0)
{
if(IsATruck(cID))
{
if(GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid), -1419.1344,-297.8153,13.6995) <= 10 )
{
new level;
if(sscanf(params,"s", level)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /loadlogs [Ammount 1-100]");
else if(level < 1 || level > 3) return SendClientMessage(playerid, COLOR_GREY,"* You cannot load less than 1 log or more than 100 logs!");
else
{
if(level == 1)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -30);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 30$ for it");
}
else if(level == 2)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -60);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 60$ for it");
}
else if(level == 3)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -90);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 90$ for it");
}
/*else if(level == 4)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -120);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 120$ for it");
}
else if(level == 5)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -150);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 150$ for it");
}
else if(level == 6)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -180);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 180$ for it");
}
else if(level == 7)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -210);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 210$ for it");
}
else if(level == 8)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -240);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 240$ for it");
}
else if(level == 9)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -270);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 270$ for it");
}
else if(level == 10)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -300);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 300$ for it");
}
else if(level == 11)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -330);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 330$ for it");
}
else if(level == 12)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -360);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 360$ for it");
}
else if(level == 13)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -390);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 390$ for it");
}
else if(level == 14)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -420);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 420$ for it");
}
else if(level == 15)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -450);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 450$ for it");
}
else if(level == 16)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -480);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 480$ for it");
}
else if(level == 17)
{
CarInfo[cID][logloaded] = level;
GivePlayerMoney(playerid, -510);
SendClientMessage(playerid, COLOR_GREEN, "You've loaded your truck with logs, and paid 510$ for it");
}*/
}
}
else return SendClientMessage(playerid, COLOR_RED, "You're not in range of loading point.");
}
else return SendClientMessage(playerid, COLOR_RED, "You're not in truck.");
}
else return SendClientMessage(playerid, COLOR_RED, "Your truck is loaded already, go and unload.");
return 1;
}