Tenta ai mano.. '-'
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#if defined FILTERSCRIPT
new dr[128];
new RoubouA[MAX_PLAYERS]= 0;
forward RoubouU(playerid);
#pragma unused strtok
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[128];
if(strcmp("/pegardrogas", cmdtext, true, 10) == 0)
{
if(RoubouA[playerid] == 1) return SendClientMessage(playerid, -1, "(ERRO) Aguarde 1 Hora para Pegar Drogas novamente!");
new grana;
grana = GetPlayerMoney(playerid);
if(PlayerToPoint(1.0, playerid, 2309.1982,-8.0864,26.7422)) {
if(grana > 199) {
SendClientMessage(playerid,-1,"(INFO) Vocк pegou as drogas, 5kg de Maconha e de Crack");
SendClientMessage(playerid,-1,"(x) Vocк pagou 200 R$ por elas. /minhasdrogas");
GivePlayerMoney(playerid, -200);
dini_IntSet(dr, "Maconha", dini_Int(dr, "Maconha")+50);
dini_IntSet(dr, "Crack", dini_Int(dr, "Crack")+50);
RoubouA[playerid] = 1;
SetTimerEx ("RoubouA" ,(60*60000) , false, "i" , playerid );
}
else {
SendClientMessage(playerid,-1,"(INFO) Vocк nгo estб na 'boca' de fumo e nгo pode pegar drogas!");
}
}
else {
SendClientMessage(playerid,-1,"(INFO) Vocк nгo tem dinheiro suficiente! [200R$]!");
}
return 1;
}
if(strcmp("/minhasdrogas", cmdtext, true, 10) == 0){
SendClientMessage(playerid, 0xFFFFFFAA, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
format(string, sizeof(string), "Maconha: %d",dini_Int(dr, "Maconha"));
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "Crack: %d",dini_Int(dr, "Crack"));
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, 0xFFFFFFAA, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
return 1;
}
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
public RoubouU()
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(RoubouA[i] == 1)
{
RoubouA[i] = 0;
SendClientMessage(i, -1, "(INFO) Vocк jб pode pegar drogas novamente!");
}
}
}