[AJUDA] /sortear viniborn
#1

Viniborn eu peguei seu codigo de zcmd e quis mudar pra DCMD
Olha
pawn Код:
dcmd_sortear(playerid,params[]) {
    #pragma unused params
    if(!strlen(params)) return SendClientMessage(playerid,blue,"Use: /sortear [quantia]");
    new VBString[64],VBNome[MAX_PLAYER_NAME],VBRand;
    VBRand = random(GetMaxPlayers());
    GetPlayerName(VBRand, VBNome, MAX_PLAYER_NAME);
    GivePlayerMoney(VBRand,params);
    format(VBString,sizeof VBString,"%s foi sorteado e ganhou %d.",VBNome,params);
    SendClientMessageToAll(-1,VBString);
    return true;
}
mais da uns erro olha
Код:
 error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Linha : GivePlayerMoney(VBRand,params);

codigo original do vini
pawn Код:
//zcmd
CMD:sortear(playerid, params[])
{
    new Quantia;
    if(sscanf(params, "d",Quantia))
        return SendClientMessage(playerid, -1, "/sortear [quantia]");

    new VBString[64],VBNome[MAX_PLAYER_NAME],VBRand;
    VBRand = random(GetMaxPlayers());
    GetPlayerName(VBRand, VBNome, MAX_PLAYER_NAME);
    GivePlayerMoney(VBRand,Quantia);
    format(VBString,sizeof VBString,"%s foi sorteado e ganhou %d.",VBNome,Quantia);
    SendClientMessageToAll(-1,BornString);
    return true;
}
por favor + rep
Reply
#2

GivePlayerMoney(VBRand, strval(params));

Ali no format troque tambйm o 'params' por 'strval(params)'
Reply
#3

pawn Код:
dcmd_sortear(playerid, params[])
{
    if(!strlen(params))
        return SendClientMessage(playerid, -1, "/sortear [quantia]");

    new Quantia = strval(params);
    new VBString[64],VBNome[MAX_PLAYER_NAME],VBRand;
    VBRand = random(GetMaxPlayers());
    GetPlayerName(VBRand, VBNome, MAX_PLAYER_NAME);
    GivePlayerMoney(VBRand,Quantia);
    format(VBString,sizeof VBString,"%s foi sorteado e ganhou %d.",VBNome,Quantia);
    SendClientMessageToAll(-1,VBString);
    return true;
}
Corrigido!
Reply
#4

Quote:
Originally Posted by paulor
Посмотреть сообщение
pawn Код:
dcmd_sortear(playerid, params[])
{
    if(!strlen(params))
        return SendClientMessage(playerid, -1, "/sortear [quantia]");

    new Quantia = strval(params);
    new VBString[64],VBNome[MAX_PLAYER_NAME],VBRand;
    VBRand = random(GetMaxPlayers());
    GetPlayerName(VBRand, VBNome, MAX_PLAYER_NAME);
    GivePlayerMoney(VBRand,Quantia);
    format(VBString,sizeof VBString,"%s foi sorteado e ganhou %d.",VBNome,Quantia);
    SendClientMessageToAll(-1,BornString);
    return true;
}
De onde saiu esse BornString ??
Reply
#5

Quote:
Originally Posted by Hancoc
Посмотреть сообщение
codigo original do vini
pawn Код:
//zcmd
CMD:sortear(playerid, params[])
{
    new Quantia;
    if(sscanf(params, "d",Quantia))
        return SendClientMessage(playerid, -1, "/sortear [quantia]");

    new VBString[64],VBNome[MAX_PLAYER_NAME],VBRand;
    VBRand = random(GetMaxPlayers());
    GetPlayerName(VBRand, VBNome, MAX_PLAYER_NAME);
    GivePlayerMoney(VBRand,Quantia);
    format(VBString,sizeof VBString,"%s foi sorteado e ganhou %d.",VBNome,Quantia);
    SendClientMessageToAll(-1,BornString);
    return true;
}
Ele postou o original! E nгo prestei atenзao q esta errado...
Reply
#6

pawn Код:
#pragma unused params
por causa disso que dб o erro.
primeiro vocк declara que o 'params' nгo serб usado e depois utiliza o mesmo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)