Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include dof2
- #include sscanf2
- #include zcmd
- #include foreach
- #define COLOR_PINK 0xFF80C0FF
- #define COR_VERMELHO 0xFF0000FF
- enum InfoPlayer {
- Maconha
- };
- new Player[MAX_PLAYERS][InfoPlayer];
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, -1, "[INFO]: Sistema de drogas desenvolvido por Gomes em prol da Pawn Coders!!");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- DOF2_Exit();
- return 1;
- }
- CMD:fumar(playerid, params[])
- {
- if(Player[playerid][Maconha] >= 5)
- {
- new string[128];
- ApplyAnimation(playerid, "SMOKING", "M_SMK_IN",4.1, 1, 0, 0, 0, 0);
- format(string, sizeof(string), "%s fumou um baseado", GetPlayerNameEx(playerid));
- SendClientMessageInRange(30.0, playerid, string, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
- Player[playerid][Maconha] -= 5;
- SetTimerEx("PararFumo",10000,true,"i",playerid);
- SetPlayerDrunkLevel(playerid, 3000);
- }
- else
- {
- SendClientMessage(playerid,-1,"[INFO]: Erro: Voce precisa ter pelo menos 5g para fumar!");
- }
- return true;
- }
- CMD:vendermaconha(playerid, params[])
- {
- new Vendeu, Gramas, Str[128];
- if(sscanf(params, "ud", Vendeu, Gramas))
- if(Vendeu == INVALID_PLAYER_ID) return SendClientMessage(playerid, COR_VERMELHO, "[SERVER]: ID invalido!");
- if(Gramas > 100 && Gramas > 5) return SendClientMessage(playerid, COR_VERMELHO, "[SERVER]: De um valor entre 100 e 1 gramas de maconha!");
- Player[Vendeu][Maconha] = Gramas;
- format(Str, sizeof Str, "[SERVER]: O traficante %s te deu %dg de maconha!", GetPlayerNameEx(playerid), Gramas);
- SendClientMessage(Vendeu, COLOR_PINK, Str);
- return 1;
- }
- forward PararFumo(playerid);
- public PararFumo(playerid)
- {
- ClearAnimations(playerid);
- return 1;
- }
- stock GetPlayerNameEx(playerid)
- {
- new Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- return Nome;
- }
- stock SendClientMessageInRange(Float:_r, playerid,const _s[],c1,c2,c3,c4,c5)
- {
- new Float:_x, Float:_y, Float:_z;
- GetPlayerPos(playerid, _x, _y, _z);
- foreach(Player, i)
- {
- if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(playerid))continue;
- if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/16)
- SendClientMessage(i, c1, _s);
- else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/8)
- SendClientMessage(i, c2, _s);
- else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/4)
- SendClientMessage(i, c3, _s);
- else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r/2)
- SendClientMessage(i, c4, _s);
- else if(GetPlayerDistanceFromPoint(i,_x,_y,_z) < _r)
- SendClientMessage(i, c5, _s);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement