Okay guys, I have it parshly working, but everytime I try and /mget at the point it says "SERVER: Unknown Command" can someone please help me?
Код:
if (strcmp(cmd, "/mget", true)==0)
{
new matget = 0;
new matsmult = 1;
new MatsGetA[MAX_PLAYERS];
new MatsGetB[MAX_PLAYERS];
new MatsGetC[MAX_PLAYERS];
if (PlayerInfo[playerid][pJob] != 9)
{
SendClientMessage(playerid,COLOR_GREY," You are not a arms dealer!");
return 1;
}
if(PlayerToPoint(3.0, playerid, 1410.2196,-1305.7535,9.3865))
{
if(PlayerInfo[playerid][pGotA] != 1)
{
if(MatsHoldingA[playerid] >= 20)
{
SendClientMessage(playerid, COLOR_GREY, "You can't hold any more Materials Packages!");
return 1;
}
moneys = MatsPickup[matget-1][MatsAmountA] * matsmult;
new price = moneys * 20;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* You bought %d A Packages for $%d.", moneys, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - price);
MatsHoldingA[playerid] = moneys;
MatsGetA[playerid] = matget;
PlayerInfo[playerid][pGotA] = 0;
return 1;
}
else
{
format(string, sizeof(string), "You can't afford the $%d!", price);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are already holding MatsA please deliver them before getting more.");
return 1;
}
}
else if(PlayerToPoint(3.0, playerid, 1514.3043,-1232.8075,16.3281))
{
if(PlayerInfo[playerid][pGotB] != 1)
{
if(MatsHoldingB[playerid] >= 20)
{
SendClientMessage(playerid, COLOR_GREY, "You can't hold any more Materials Packages!");
return 1;
}
moneys = MatsPickup[matget-1][MatsAmountB] * matsmult;
new price = moneys * 20;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* You bought %d A Packages for $%d.", moneys, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - price);
MatsHoldingB[playerid] = moneys;
MatsGetB[playerid] = matget;
PlayerInfo[playerid][pGotB] = 0;
return 1;
}
else
{
format(string, sizeof(string), "You can't afford the $%d!", price);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are already holding MatsA please deliver them before getting more.");
return 1;
}
}
else if(PlayerToPoint(3.0, playerid, 2605.9275,-1470.6278,16.7677))
{
if(PlayerInfo[playerid][pGotC] != 1)
{
if(MatsHoldingC[playerid] >= 20)
{
SendClientMessage(playerid, COLOR_GREY, "You can't hold any more Materials Packages!");
return 1;
}
moneys = MatsPickup[matget-1][MatsAmountC] * matsmult;
new price = moneys * 15;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* You bought %d C Packages for $%d.", moneys, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - price);
MatsHoldingC[playerid] = moneys;
MatsGetC[playerid] = matget;
PlayerInfo[playerid][pGotC] = 0;
return 1;
}
else
{
format(string, sizeof(string), "You can't afford the $%d!", price);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are already holding MatsC please deliver them before getting more.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not at a materials pickup.");
return 1;
}
}