PDA

View Full Version : Command Not Recognized.....?


Dokins
08/12/2011, 12:28 PM
Apparently my server doesn't recognize this command; I'm guessing that there is an error somewhere that hasn't come up when compiling.

Can someone help me identify it?

CMD:housestore(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(HouseOwned[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You don't have a house.");
new function[16], slot, houseid, weapon[32];
if(sscanf(params, "s[16]", function)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /housestore [function] Available functions: Weapon, Money - (more coming soon)");

if(strcmp(function, "weapon", true) == 0)
{
if(sscanf(params, "s[16]ds[32]", function, slot, weapon)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /housestore weapon slot [weapon name]");
if(slot < 1 || slot > 3) return SendClientMessage(playerid, COLOUR_GREY, "Invalid slot (1-3).");


houseid = GetPlayerHouseID(playerid);
new weaponstored, ammostored, string[128];

if(GetPlayerHouseID(playerid) < 1)return SendClientMessage(playerid, COLOUR_GREY, "You don't own this house.");
if(HouseWS1[houseid] || HouseWS2[houseid] || HouseWS3[houseid] >= 1) return SendClientMessage(playerid, COLOUR_GREY, "That slot is already occupied.");
if(!IsPlayerInRangeOfPoint(playerid, 30.0, HouseEntX[houseid], HouseEntY[houseid], HouseEntZ[houseid]))return SendClientMessage(playerid, COLOUR_GREY, "You're not inside your house.");
{
if(GetPlayerInterior(playerid) == HouseInt[houseid])
{
if(strcmp(weapon, "9mm", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][2] == 22 && PlayerWeaponAmmo[playerid][2] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a 9mm in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][2];
ammostored = PlayerWeaponAmmo[playerid][2];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][2]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][2];
ammostored = PlayerWeaponAmmo[playerid][2];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][2]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][2];
ammostored = PlayerWeaponAmmo[playerid][2];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][2]);
}
format(string,sizeof(string), "* %s stores a 9mm in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "desert eagle", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][2] == 24 && PlayerWeaponAmmo[playerid][2] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a desert eagle in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][2];
ammostored = PlayerWeaponAmmo[playerid][2];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][2]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][2];
ammostored = PlayerWeaponAmmo[playerid][2];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][2]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][2];
ammostored = PlayerWeaponAmmo[playerid][2];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][2]);
}
format(string,sizeof(string), "* %s stores a desert eagle in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "shotgun", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][3] == 25 && PlayerWeaponAmmo[playerid][3] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a shotgun in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][3];
ammostored = PlayerWeaponAmmo[playerid][3];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][3]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][3];
ammostored = PlayerWeaponAmmo[playerid][3];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][3]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][3];
ammostored = PlayerWeaponAmmo[playerid][3];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][3]);
}
format(string,sizeof(string), "* %s stores a shotgun in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "spas12", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][3] == 27 && PlayerWeaponAmmo[playerid][3] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a spas 12 in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][3];
ammostored = PlayerWeaponAmmo[playerid][3];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][3]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][3];
ammostored = PlayerWeaponAmmo[playerid][3];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][3]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][3];
ammostored = PlayerWeaponAmmo[playerid][3];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][3]);
}
format(string,sizeof(string), "* %s stores a spas 12 in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "mp5", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][4] == 29 && PlayerWeaponAmmo[playerid][4] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a spas 12 in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
format(string,sizeof(string), "* %s stores an mp5 in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "ak47", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][5] == 30 && PlayerWeaponAmmo[playerid][5] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored an AK-47 in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][5]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][5]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][5]);
}
format(string,sizeof(string), "* %s stores an AK-47 in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "m4", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][5] == 31 && PlayerWeaponAmmo[playerid][5] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored an M4 in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][5]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][5]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][5]);
}
format(string,sizeof(string), "* %s stores an M4 in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "rifle", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][6] == 33 && PlayerWeaponAmmo[playerid][6] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a Rifle in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][6];
ammostored = PlayerWeaponAmmo[playerid][6];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][6]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][5];
ammostored = PlayerWeaponAmmo[playerid][5];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][6]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][6];
ammostored = PlayerWeaponAmmo[playerid][6];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][6]);
}
format(string,sizeof(string), "* %s stores a rifle in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "sniper", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][6] == 34 && PlayerWeaponAmmo[playerid][6] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a Sniper in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][6];
ammostored = PlayerWeaponAmmo[playerid][6];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][6]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][6];
ammostored = PlayerWeaponAmmo[playerid][6];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][6]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][6];
ammostored = PlayerWeaponAmmo[playerid][6];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][6]);
}
format(string,sizeof(string), "* %s stores a sniper rifle in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "uzi", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][4] == 28 && PlayerWeaponAmmo[playerid][4] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored an UZI in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
format(string,sizeof(string), "* %s stores an uzi in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
else if(strcmp(weapon, "tec9", true, strlen(weapon)) == 0)
{
if(PlayerWeapons[playerid][4] == 32 && PlayerWeaponAmmo[playerid][4] >= 1)
{
SendClientMessage(playerid, COLOUR_GREY, "You have stored a tec 9 in your house.");
if(slot == 1)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS1",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA1",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
if(slot == 2)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS2",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA2",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
if(slot == 3)
{
weaponstored = PlayerWeapons[playerid][4];
ammostored = PlayerWeaponAmmo[playerid][4];
MySQL_SetInteger(HouseSQLID[houseid], "HouseWS3",weaponstored,"houses");
MySQL_SetInteger(HouseSQLID[houseid], "HouseWA3",ammostored,"houses");
RemovePlayerWeapon(playerid, PlayerWeapons[playerid][4]);
}
format(string,sizeof(string), "* %s stores a tec 9 in their house.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_PURPLE,COLOUR_P URPLE,COLOUR_PURPLE);
}
}
}
}
}
return 1;
}



+ rep for fix!

Dokins
08/12/2011, 01:22 PM
Thanks for that, I just don't know where to place them, can I ask you to have a look at this and tell me why it wont work? It's a very short command, and the fact that it doesnt work confuses me.


CMD:report(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
new giveplayerid, string[128];
if(sscanf(params, "us[64]",giveplayerid, string)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /report [playerid] [message]");
if(Report[playerid] == 1) return SendClientMessage(playerid, COLOUR_GREY, "You have already submitted a report, Please wait until it has been processed.");


SendClientMessage(playerid, COLOUR_ORANGE, "Your report has been submitted to all available admins.");
strcpy(ReportMessage[playerid],params, 64);
Report[playerid] = 1;
format(string, sizeof(string), "Report from %s (ID %d), Details: %s, to manage this report, use /reports", GetNameEx(playerid), playerid, params);
AdminMessage(string, COLOUR_YELLOW);
return 1;
}

Speed
08/12/2011, 02:13 PM
debug your code