29.04.2013, 05:37
pawn Код:
CMD:giveweed(playerid,params[])
{
if(PlayerInfo[playerid][pJob] == 1)
{
new targetid,type;
if(sscanf(params, "ud", targetid, type)) return SendClientMessage(playerid, -1, "[Usage]: /giveweed [Part of Name/Player ID] [Amount]");
if(type > PlayerInfo[playerid][pStressweed])return SendClientMessage(playerid,-1,"ERROR: You do not have that much weed!");
if(type > PlayerInfo[playerid][pChronicweed])return SendClientMessage(playerid,-1,"ERROR: You do not have that much weed!");
if(type > PlayerInfo[playerid][pKushweed])return SendClientMessage(playerid,-1,"ERROR: You do not have that much weed!");
if(targetid == playerid)return SendClientMessage(playerid,-1,"ERROR: You cannot give drugs to your self!");
PlayerInfo[playerid][pStressweed] -= type;
PlayerInfo[targetid][pStressweed] +=type;
PlayerInfo[playerid][pChronicweed] -= type;
PlayerInfo[targetid][pChronicweed] +=type;
PlayerInfo[playerid][pKushweed] -= type;
PlayerInfo[targetid][pKushweed] +=type;
}
return 1;
}