Erro ao compilar
#6

A include Dutils
Quote:

109 - stock HexToInt(string[]) {
if (string[0]==0) return 0;
new i;
new cur=1;
new res=0;
for (i=strlen(string);i>0;i--) {
if (string[i-1]<5 res=res+cur*(string[i-1]-4; else res=res+cur*(string[i-1]-65+10);
cur=cur*16;
}
return res;
}

/**
* Return the int as string
* @param number
*/
stock IntToHex(number)
{
new m=1;
new depth=0;
while (number>=m) {
m = m*16;
depth++;
}
depth--;
new str[MAX_STRING];
for (new i = depth; i >= 0; i--)
{
str[i] = ( number & 0x0F) + 0x30; // + (tmp > 9 ? 0x07 : 0x00)
str[i] += (str[i] > '9') ? 0x07 : 0x00;
number >>= 4;
}
str[8] = '\0';
return str;
}

/**
* Return the string as int
* @param string
*/
stock StrToInt(string[]) {
return strval(string);
}

/**
* Return the value as string
* @param value
*/
stock IntToStr(value) {
new tmp[MAX_STRING];
valstr(tmp, value);
return tmp;
}

/**
* Return the truncated value
* @param Float:value
*/
stock trunc(Float:value) {
return floatround(value,floatround_floor);
}

/**
* Sets money for player
* @param playerid
* howmuch
*/
stock SetPlayerMoney(playerid,howmuch) {
PRIVATE_Last_Money[playerid]=howmuch;
GivePlayerMoney(playerid,howmuch-GetPlayerMoney(playerid));
179 - }

Reply


Messages In This Thread
Erro ao compilar - by Moskito - 04.08.2013, 01:22
Re: Erro ao compilar - by [A]rray - 04.08.2013, 01:30
Re: Erro ao compilar - by GabrielSantos - 04.08.2013, 01:34
Re: Erro ao compilar - by Moskito - 04.08.2013, 01:37
Re: Erro ao compilar - by GabrielSantos - 04.08.2013, 01:40
Re: Erro ao compilar - by Moskito - 04.08.2013, 01:42
Re: Erro ao compilar - by shittt - 04.08.2013, 01:46
Re: Erro ao compilar - by GabrielSantos - 04.08.2013, 01:47
Re: Erro ao compilar - by Moskito - 04.08.2013, 01:50
Re: Erro ao compilar - by GabrielSantos - 04.08.2013, 02:00

Forum Jump:


Users browsing this thread: 1 Guest(s)