06.12.2009, 06:35
well, I've got an error that i can't seem to figure out.
Like i go to the materials pick-up and when i type in /materials getmats it says.
So if someone can help me out I'd appreciate it, and if it's not to much to ask can someone make it so that all i have to do is enter /getmats /sellmats instead of typing in /materials getmats etc..to long lol
Thanks in Advance.
Код:
return 1; } if(strcmp(cmd, "/materials", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pJob] != 1) { SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not an arms dealer"); return 1; } new x_nr[256]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /materials [usage]"); SendClientMessage(playerid, COLOR_WHITE, "[Usages:] getmats | sellmats"); return 1; } if(strcmp(x_nr, "getmats", true) == 0) { if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ])) { if(MatsHolding[playerid] >= 10) { SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /materials [usage]"); SendClientMessage(playerid, COLOR_WHITE, "[Usages:] getmats | sellmats"); return 1; } new moneys; moneys = strval(tmp); if(moneys < 1 || moneys > 10) { SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10"); return 1; } new price = moneys * 100; if(GetPlayerCash(playerid) > price) { format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price); SendClientMessage(playerid, COLOR_WHITE, string); GivePlayerCash(playerid, - price); MatsHolding[playerid] = moneys; } else { format(string, sizeof(string), "[Error:] You do not have $%d", price); SendClientMessage(playerid, COLOR_GREY, string); } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place"); return 1; } } else if(strcmp(x_nr, "sellmats", true) == 0) { if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ])) { if(MatsHolding[playerid] > 0) { new payout = (50)*(MatsHolding[playerid]); format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout); SendClientMessage(playerid, COLOR_WHITE, string); PlayerInfo[playerid][pMaterials] += payout; MatsHolding[playerid] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage"); return 1; } } return 1; }
So if someone can help me out I'd appreciate it, and if it's not to much to ask can someone make it so that all i have to do is enter /getmats /sellmats instead of typing in /materials getmats etc..to long lol
Thanks in Advance.