YCMD:store(playerid, params[], help)
{
if(help) return SCM(playerid, COLOR_GREY, "Not supported");
if(IsPlayerConnected(playerid))
{
new lname[24], amount;
if(sscanf(params, "s[60]d", lname, amount))
{
SCM(playerid, COLOR_WHITE, "USAGE: /store [name] [amount/ammo]");
SCM(playerid, COLOR_WHITE, "Available names: drugs, materials, weapon, weapon2, weapon3, weapon4, weapon5, weapon6");
return 1;
}
if(strcmp(params,"drugs",true) == 0)
{
new string[256], dammount, house = PlayerInfo[playerid][pPhousekey];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", dammount))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store drugs [amount]");
format(string, sizeof(string),"* You are Carrying %d Drugs",PlayerInfo[playerid][pDrugs]);
SCM(playerid, COLOR_GRAD1, string);
return 1;
}
if(dammount > PlayerInfo[playerid][pDrugs]) return SCM(playerid, COLOR_GREY, " You don't have so many drugs.");
if(HouseInfo[house][hDrugs] >= 10000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 10000 Limit.");
PlayerInfo[playerid][pDrugs] -= dammount;
HouseInfo[house][hDrugs] += dammount;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his sack with drugs and places it on the safe.", GetPlayerNameEx(playerid)); }
else { format(string, sizeof(string), "* %s takes out her sack with drugs and places it on the safe.", GetPlayerNameEx(playerid)); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"materials",true) == 0)
{
new string[256], dammount, house = PlayerInfo[playerid][pPhousekey];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", dammount))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store materials [amount]");
format(string, sizeof(string),"* You are Carrying %d Materials",PlayerInfo[playerid][pMats]);
SCM(playerid, COLOR_GRAD1, string);
return 1;
}
if(dammount > PlayerInfo[playerid][pMats]) return SCM(playerid, COLOR_GREY, "* You don't have so many Materials.");
if(HouseInfo[house][hMaterials] >= 35000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 35000 Limit.");
PlayerInfo[playerid][pMats] -= dammount;
HouseInfo[house][hMaterials] += dammount;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his sack with materials and places it on the safe.", GetPlayerNameEx(playerid)); }
else { format(string, sizeof(string), "* %s takes out her sack with materials and places it on the safe.", GetPlayerNameEx(playerid)); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"weapon",true) == 0)
{
new string[256], ammo, house = PlayerInfo[playerid][pPhousekey];
new gunname[24];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", ammo))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store weapon [ammo]");
return 1;
}
if(ammo > GetPlayerAmmo(playerid))
{
SCM(playerid, COLOR_GREY, " You don't have so many Ammo.");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
GetWeaponName(weapon,gunname, sizeof(gunname));
if(weapon != 0)
{
if(HouseInfo[house][hWeapon][1] == 0)
{
if(HouseInfo[house][hAmmo][2] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hWeapon][2] = weapon;
HouseInfo[house][hAmmo][2] = ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else if(HouseInfo[house][hWeapon][2] == weapon)
{
if(HouseInfo[house][hAmmo][2] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hAmmo][2] += ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
return 1;
}
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"weapon2",true) == 0)
{
new string[256], ammo, house = PlayerInfo[playerid][pPhousekey];
new gunname[24];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", ammo))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store weapon2 [ammo]");
return 1;
}
if(ammo > GetPlayerAmmo(playerid))
{
SCM(playerid, COLOR_GREY, " You don't have so many Ammo.");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
GetWeaponName(weapon,gunname, sizeof(gunname));
if(weapon != 0)
{
if(HouseInfo[house][hWeapon][1] == 0)
{
if(HouseInfo[house][hAmmo][1] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hWeapon][1] = weapon;
HouseInfo[house][hAmmo][1] = ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else if(HouseInfo[house][hWeapon][1] == weapon)
{
if(HouseInfo[house][hAmmo][1] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hAmmo][1] += ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
return 1;
}
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You don't have any weapon in your hand!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"weapon3",true) == 0)
{
new string[256], ammo, house = PlayerInfo[playerid][pPhousekey];
new gunname[24];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", ammo))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store weapon3 [ammo]");
return 1;
}
if(ammo > GetPlayerAmmo(playerid))
{
SCM(playerid, COLOR_GREY, " You don't have so many Ammo.");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
GetWeaponName(weapon,gunname, sizeof(gunname));
if(weapon != 0)
{
if(HouseInfo[house][hWeapon][2] == 0)
{
if(HouseInfo[house][hAmmo][2] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hWeapon][2] = weapon;
HouseInfo[house][hAmmo][2] = ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else if(HouseInfo[house][hWeapon][2] == weapon)
{
if(HouseInfo[house][hAmmo][2] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hAmmo][2] += ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
return 1;
}
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You don't have any weapon in your hand!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"weapon4",true) == 0)
{
new string[256], ammo, house = PlayerInfo[playerid][pPhousekey];
new gunname[24];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", ammo))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store weapon4 [ammo]");
return 1;
}
if(ammo > GetPlayerAmmo(playerid))
{
SCM(playerid, COLOR_GREY, " You don't have so many Ammo.");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
GetWeaponName(weapon,gunname, sizeof(gunname));
if(weapon != 0)
{
if(HouseInfo[house][hWeapon][3] == 0)
{
if(HouseInfo[house][hAmmo][3] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hWeapon][3] = weapon;
HouseInfo[house][hAmmo][3] = ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else if(HouseInfo[house][hWeapon][3] == weapon)
{
if(HouseInfo[house][hAmmo][3] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hAmmo][3] += ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
return 1;
}
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You don't have any weapon in your hand!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"weapon5",true) == 0)
{
new string[256], ammo, house = PlayerInfo[playerid][pPhousekey];
new gunname[24];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", ammo))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store weapon5 [ammo]");
return 1;
}
if(ammo > GetPlayerAmmo(playerid))
{
SCM(playerid, COLOR_GREY, " You don't have so many Ammo.");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
GetWeaponName(weapon,gunname, sizeof(gunname));
if(weapon != 0)
{
if(HouseInfo[house][hWeapon][4] == 0)
{
if(HouseInfo[house][hAmmo][4] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hWeapon][4] = weapon;
HouseInfo[house][hAmmo][4] = ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else if(HouseInfo[house][hWeapon][4] == weapon)
{
if(HouseInfo[house][hAmmo][4] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hAmmo][4] += ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
return 1;
}
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You don't have any weapon in your hand!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
else if(strcmp(params,"weapon6",true) == 0)
{
new string[256], ammo, house = PlayerInfo[playerid][pPhousekey];
new gunname[24];
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
if(sscanf(params, "d", ammo))
{
SCM(playerid, COLOR_GRAD1, "USAGE: /store weapon6 [ammo]");
return 1;
}
if(ammo > GetPlayerAmmo(playerid))
{
SCM(playerid, COLOR_GREY, " You don't have so many Ammo.");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
GetWeaponName(weapon,gunname, sizeof(gunname));
if(weapon != 0)
{
if(HouseInfo[house][hWeapon][5] == 0)
{
if(HouseInfo[house][hAmmo][5] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hWeapon][5] = weapon;
HouseInfo[house][hAmmo][5] = ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else if(HouseInfo[house][hWeapon][5] == weapon)
{
if(HouseInfo[house][hAmmo][5] >= 25000) return SCM(playerid, COLOR_GREY,"* You cannot exceed the 25000 Limit.");
SafeGivePlayerWeapon(playerid, weapon, -ammo);
HouseInfo[house][hAmmo][5] += ammo;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his %s and places it at his safe.", GetPlayerNameEx(playerid),gunname); }
else { format(string, sizeof(string), "* %s takes out her %s and places it at her safe.", GetPlayerNameEx(playerid),gunname); }
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SCM(playerid, COLOR_GREY,"* This slot is taken by another weapon!");
SCM(playerid, COLOR_GREY,"* Either deposit more ammo of the same weapon or load it up!");
return 1;
}
OnPropUpdate(1, house);
}
else
{
SCM(playerid, COLOR_GREY,"* You don't have any weapon in your hand!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY,"* You're not on your House!");
return 1;
}
}
}
return 1;
}
really i cant get your point , can you explain again what are you trying to Say ?
|
You need debug points in your code... Various lines that show what variables the script is processing, and what values it got from those variables.
Anyways, so where's it failing and what messages is it giving to the client when these are processed? |