25.04.2010, 10:04
if(strcmp(cmd, "/fselldrugs", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Farmer!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fselldrugs [playerid/PartOfName] [ammount] [price]");
return 1;
}
new playa;
new money;
new needed;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
needed = strval(tmp);
if(needed < 1 || needed > 99) { SendClientMessage(playerid, COLOR_GREY, " Grams not lower then 1, or above 99!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
money = strval(tmp);
if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1, or above 99999!"); return 1; }
if(needed > PlayerInfo[playerid][pDrugs]) { SendClientMessage(playerid, COLOR_GREY, " You dont have that much Drugs with you !"); return 1; }
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, playa))
{
if(playa == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You offerd %s to buy %d gram of drugs for $%d .", giveplayer, needed, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Farmer %s wants to sell you %d gram for $%d, (type /accept drugs) to buy.", sendername, needed, money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
DrugOffer[playa] = playerid;
DrugPrice[playa] = money;
DrugGram[playa] = needed;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acel Player nu este langa tine !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acel Player este Offline.");
}
}
return 1;
}
its sayd im not a farmer ?? why help plz
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Farmer!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fselldrugs [playerid/PartOfName] [ammount] [price]");
return 1;
}
new playa;
new money;
new needed;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
needed = strval(tmp);
if(needed < 1 || needed > 99) { SendClientMessage(playerid, COLOR_GREY, " Grams not lower then 1, or above 99!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
money = strval(tmp);
if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1, or above 99999!"); return 1; }
if(needed > PlayerInfo[playerid][pDrugs]) { SendClientMessage(playerid, COLOR_GREY, " You dont have that much Drugs with you !"); return 1; }
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, playa))
{
if(playa == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You offerd %s to buy %d gram of drugs for $%d .", giveplayer, needed, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Farmer %s wants to sell you %d gram for $%d, (type /accept drugs) to buy.", sendername, needed, money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
DrugOffer[playa] = playerid;
DrugPrice[playa] = money;
DrugGram[playa] = needed;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acel Player nu este langa tine !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acel Player este Offline.");
}
}
return 1;
}
its sayd im not a farmer ?? why help plz