[Ajuda] sscanf 2 ajuda
#4

pawn Код:
if(!strcmp(cmdtext,"/transfer"))
{
    new quantidade, ID;
    new string[80];
    if (sscanf(cmdtext,"ud",ID,quantidade)) //Sscanf retorna 1 quando os parвmetros nгo sгo completados com sucesso
    return SendClientMessage(playerid , 0xFF0000FF , "Uso Correto /transfer [id] [value]" ); //OBS: Parвmetros aleatуrios.
    if(bank[playerid] < quantidade)  return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo tem todo esse dinheiro!");
    format(string, sizeof(string), "%s transferiu %d para %s!", PlayerName(playerid), quantidade, PlayerName(ID) );
    SendClientMessage(playerid, COLOR_GREEN, string);
    SendClientMessage(ID, COLOR_GREEN, string);
    bank[playerid] -= quantidade;
    bank[ID] += quantidade;
    return 1;
}
caso continue dando erro coloque no inicio da onplayercommandotext
pawn Код:
new cmdtext[40];
Reply


Messages In This Thread
sscanf 2 ajuda - by luccagomes15 - 20.12.2014, 17:59
Re: sscanf 2 ajuda - by MultiKill - 20.12.2014, 18:05
Re: sscanf 2 ajuda - by luccagomes15 - 20.12.2014, 18:20
Re: sscanf 2 ajuda - by WendeLKILL - 20.12.2014, 18:26
Re: sscanf 2 ajuda - by MultiKill - 20.12.2014, 18:29
Re: sscanf 2 ajuda - by luccagomes15 - 20.12.2014, 18:37
Re: sscanf 2 ajuda - by MultiKill - 20.12.2014, 18:40
Re: sscanf 2 ajuda - by WendeLKILL - 20.12.2014, 18:54
Re: sscanf 2 ajuda - by luccagomes15 - 20.12.2014, 19:13
Re: sscanf 2 ajuda - by MultiKill - 20.12.2014, 19:29

Forum Jump:


Users browsing this thread: 4 Guest(s)