
if(strcmp(cmd, "/givedrugs", true) == 0) {
if(wantsdrugs[giveplayerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "That player does not want drugs. Use /selldrugs ID to offer drugs to a player");
return 1;
}
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
return 1;
}
if(Jailed[playerid] == 1) {
SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail");
return 1;
}
if(InDerby[playerid] == 1) {
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command while you are in the stadium");
return 1;
}
if(cuffed[playerid] == 1) {
SendClientMessage(playerid,COLOR_ERROR,"You are handcuffed. You cannot use this command");
return 1;
}
if(gTeam[playerid] != TEAM_DRGDEL) {
SendClientMessage(playerid,COLOR_ERROR,"You are not a Drug Dealer");
return 1;
}
if(solddrugsrecent[playerid] == 1) {
SendClientMessage(playerid,COLOR_ERROR,"Command used recently... Please wait");
return 1;
}
if(PlayerDrugs[playerid] == 0) {
SendClientMessage(playerid,COLOR_ERROR,"You are not carrying any drugs. Visit the drug house to get your supply");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /givedrugs (id) [Grams]");
return 1;
}
giveplayerid = strval(tmp);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /givedrugs (id) [Grams] ID Must be a number");
return 1;
}
// if(IsNumeric(tmp) > 502) {
// SendClientMessage(playerid, COLOR_ERROR, "Nice try.");
// return 1;
// }
if(strval(tmp) == playerid) {
SendClientMessage(playerid, COLOR_ERROR, "You cannot sell yourself drugs");
return 1;
}
if(gTeam[giveplayerid] <=2) {
SendClientMessage(playerid, COLOR_ERROR, "You cannot give drugs to a Law Enforcement agent");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /givedrugs (id) [Grams]");
return 1;
}
new gramtogive = strval(tmp);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /givedrugs (id) [Grams] Grams must be a number");
return 1;
}
if(!IsPlayerConnected(giveplayerid)) {
format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
if(gramtogive <=0) {
SendClientMessage(playerid, COLOR_ERROR, "Minimum amount of grams you can give in one transaction is 1 Gram");
return 1;
}
if(gramtogive >=501) {
SendClientMessage(playerid, COLOR_ERROR, "Maximum amount of grams you can give in one transaction is 500 Grams");
return 1;
}
if(PlayerDrugs[playerid] < gramtogive) {
SendClientMessage(playerid,COLOR_ERROR,"You are not carrying that much drugs. Visit the drug house to replenish your supply");
return 1;
}
new dealername[24];
new buyername[24];
GetPlayerName(playerid,dealername, 24);
GetPlayerName(giveplayerid,buyername, 24);
if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 7) {
format(string, sizeof(string), "%s(%d) Is not close enough. You cannot deal drugs to that player",buyername,giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_Drugs Purchased_|");
format(string, sizeof(string), "Drug Dealer %s(%d) has given you %d grams of drugs. Make sure you pay/have paid the dealer",dealername,playerid,gramtogive);
SendClientMessage(giveplayerid, COLOR_DODGERBLUE, string);
SendClientMessage(giveplayerid, COLOR_DODGERBLUE, "Use /takedrugs (grams) to use drugs. Remember, cops can search you for drugs...try /throwaway in emergency");
SendClientMessage(playerid, 0xA9A9A9AA, "|_Drugs Sold_|");
format(string, sizeof(string), "You have given %s(%d) %d grams of drugs. Make sure you get paid",buyername,giveplayerid,gramtogive);
SendClientMessage(playerid, 0x00C7FFAA, string);
PlayerDrugs[playerid] -= gramtogive;
PlayerDrugs[giveplayerid] += gramtogive;
oscore = GetPlayerScore(playerid);
SetPlayerScore(playerid, oscore +1);
new current_zone;
current_zone = player_zone[playerid];
commitedcrimerecently[playerid] +=180;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(LawEnforcementRadio[i] == 1) {
format(string, sizeof(string), "DISPATCH: (DRUG DEALING) Suspected drug deal has taken place - Suspect: %s(%d) Location: %s",dealername,playerid,zones[current_zone][zone_name]);
SendClientMessage(i,COLOR_ROYALBLUE,string);
}
}
new plwl = GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid, plwl +2 );
new pcol = GetPlayerColor(playerid);
plwl = GetPlayerWantedLevel(playerid);
SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|");
format(string, sizeof(string), "(DRUG DEALING) Wanted Level %d",plwl);
SendClientMessage(playerid,pcol,string);
return 1;
}
if(IsNumeric(tmp) > 502)
if(giveplayerid > MAX_PLAYERS)
if(strval(tmp) == playerid)
if(giveplayerid == playerid)
|
Originally Posted by Jason_Borne
Its commented out, i just added it in and it did nothing. So its not that, right? Anyone know how to fix this?
|
|
Originally Posted by Weirdosport
Replace:
pawn Код:
pawn Код:
|
stock strint(input[])
{
if(strlen(input) < 25) return strval(input);
return -1;
}