[Ajuda] /darmaconha e /darcocaina
#1

Tipow eu queria um comando que que tem abaixo sу pra basear aqui embaixo:

maconha:
pawn Код:
if(GetPlayerMoney(playerid) >= 8000)
{
Maconha[playerid] += 80;
GetPlayerName(playerid, sendername, sizeof(sendername));
dini_IntSet(udb_encode(sendername), "Maconha", Maconha[playerid]);
GivePlayerMoney(playerid, -8000);
SendClientMessage(playerid, 0x33AAFFFF, "Vocк comprou pacote de 80 de maconha, para usar: /usarmaconha");
}
cocaina:
pawn Код:
if(GetPlayerMoney(playerid) >= 2000)
{
Cocaina[playerid] += 10;
GetPlayerName(playerid, sendername, sizeof(sendername));
dini_IntSet(udb_encode(sendername), "Cocaina", Cocaina[playerid]);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, 0x33AAFFFF, "Vocк comprou 10 de pу, para usar: /usarcocaina");

}
Reply
#2

pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#include <zcmd>
#include <sscanf>

new Maconha[MAX_PLAYERS];
new Cocaina[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Dar cocaina e maconha [Rhay_Fither]");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

CMD:darcocaina(playerid, params[])
{
    new zID, zQuantia, zString[128], zNome[MAX_PLAYER_NAME];
    if(sscanf(params, "ud", zID, zQuantia)) return SendClientMessage(playerid, -1, "USE: /darcocaina [ID] [QUANTIA]");
    if(!IsPlayerConnected(zID)) return SendClientMessage(playerid, -1, "Player nгo connectado!");
    Cocaina[zID] += zQuantia;
    GetPlayerName(playerid,zNome,MAX_PLAYER_NAME);
    format(zString,sizeof(zString),"O Admin %s te deu %d de cocaina!", zNome, zQuantia);
    SendClientMessage(zID, -1, zString);
    return 1;
}

CMD:darmaconha(playerid, params[])
{
    new zID, zQuantia, zString[128], zNome[MAX_PLAYER_NAME];
    if(sscanf(params, "ud", zID, zQuantia)) return SendClientMessage(playerid, -1, "USE: /darmaconha [ID] [QUANTIA]");
    if(!IsPlayerConnected(zID)) return SendClientMessage(playerid, -1, "Player nгo connectado!");
    Maconha[zID] += zQuantia;
    GetPlayerName(playerid,zNome,MAX_PLAYER_NAME);
    format(zString,sizeof(zString),"O Admin %s te deu %d de maconha!", zNome, zQuantia);
    SendClientMessage(zID, -1, zString);
    return 1;
}
Se ajudei, +rep!
Reply
#3

vlw mais tipow tentei deixar ele em comando mesmo sem ser FS:
pawn Код:
if(strcmp(cmd, "/darcocaina", true) == 0)
    {
    new zID, zQuantia, zString[128], zNome[MAX_PLAYER_NAME];
    if(sscanf(params, "ud", zID, zQuantia)) return SendClientMessage(playerid, -1, "USE: /darcocaina [ID] [QUANTIA]");
    if(!IsPlayerConnected(zID)) return SendClientMessage(playerid, -1, "Player nгo connectado!");
    Cocaina[zID] += zQuantia;
    GetPlayerName(playerid,zNome,MAX_PLAYER_NAME);
    format(zString,sizeof(zString),"O Admin %s te deu %d de cocaina!", zNome, zQuantia);
    SendClientMessage(zID, -1, zString);
    return 1;
}

    if(strcmp(cmd, "/darmaconha", true) == 0)
    {
    new zID, zQuantia, zString[128], zNome[MAX_PLAYER_NAME];
    if(sscanf(params, "ud", zID, zQuantia)) return SendClientMessage(playerid, -1, "USE: /darmaconha [ID] [QUANTIA]");
    if(!IsPlayerConnected(zID)) return SendClientMessage(playerid, -1, "Player nгo connectado!");
    Maconha[zID] += zQuantia;
    GetPlayerName(playerid,zNome,MAX_PLAYER_NAME);
    format(zString,sizeof(zString),"O Admin %s te deu %d de maconha!", zNome, zQuantia);
    SendClientMessage(zID, -1, zString);
    return 1;
}
olha que deu: 2 warnings acho que e fбcil de resolver:
Код:
C:\Users\Familia\Desktop\bgt\admin.PWN(2354) : error 017: undefined symbol "params"
C:\Users\Familia\Desktop\bgt\admin.PWN(2366) : error 017: undefined symbol "params"
linhas:
Код:
2354:    if(sscanf(params, "ud", zID, zQuantia)) return SendClientMessage(playerid, -1, "USE: /darcocaina [ID] [QUANTIA]"); 
2366:    if(sscanf(params, "ud", zID, zQuantia)) return SendClientMessage(playerid, -1, "USE: /darmaconha [ID] [QUANTIA]");
Reply
#4

Our ta you for trying ZCMD in strcmp, study more about pwn.
Reply
#5

ALGUЙM AJUDA '-'
Reply
#6

;/ nгo tem geito de deixar em cmd normal?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)