Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/givedrugs", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /givedrugs [playerid/PartOfName] [amount]");
- return 1;
- }
- //giveplayerid = strval(tmp);
- giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /givedrugs [playerid/PartOfName] [amount]");
- return 1;
- }
- moneys = strval(tmp);
- if (IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (ProxDetectorS(5.0, playerid, giveplayerid))
- {
- if(moneys > 0 && PlayerInfo[playerid][pDrugs] >= moneys)
- {
- ConsumingMoney[giveplayerid] = 1;
- PlayerInfo[giveplayerid][pDrugs] += moneys;
- PlayerInfo[playerid][pDrugs] -= moneys;
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), " You have sent %s(player: %d), %d Drugs.", giveplayer,giveplayerid, moneys);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- format(string, sizeof(string), " You have recieved %d Drugs from %s(player: %d).", moneys, sendername, playerid);
- SendClientMessage(giveplayerid, COLOR_GRAD1, string);
- format(string, sizeof(string), "%s has gived you %d Drugs to %s", sendername, moneys, giveplayer);
- PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "* %s takes out some Drugs, and hands it to %s.", sendername ,giveplayer);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much Drugs on you !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " Your too far away.");
- }
- }//invalid id
- }
- else
- {
- format(string, sizeof(string), " %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment