30.01.2016, 14:26
Alguйm pode me ajudar com 1 rank de base pra que eu possa criar os outros
/rank bank
Informaзхes \/
variavel
save da variavel bank
Carregamento da variavel
/rank bank
Informaзхes \/
variavel
Код:
new bank[MAX_PLAYERS]
Код:
stock OnPlayerSave(playerid) { new query[2500], ip[25]; GetPlayerIp(playerid, ip, sizeof(ip)); money[playerid] = GetPlayerMoneyEx(playerid); mysql_format(ConnectMYSQL, query, sizeof(query), "UPDATE `accounts` SET `Username` = '%s', `IP` = '%s', `scorelevel` = '%d', `maconha` = '%d', `material` = '%d', `sementes` = '%d', `lastlogin` = '%d', `wanted` = '%d', `moneybag` = '%d', `COPskills` = '%d', `CRIMINALskills` = '%d', `PARAMEDICskills` = '%d', `admin` = '%d', `money` = '%d', `bank` = '%d' WHERE `Username` = '%s' ", GetName(playerid), ip, scorelevel[playerid], maconha[playerid], material[playerid], sementes[playerid], lastlogin[playerid], wanted[playerid], moneybag[playerid], COPskills[playerid], CRIMINALskills[playerid], PARAMEDICskills[playerid], admin[playerid], money[playerid], bank[playerid], GetName(playerid)); mysql_pquery(ConnectMYSQL, query);
Код:
stock OnPlayerLogin(playerid) { new query[512], rows, fields; mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Username` = '%s'", Nome(playerid) ); mysql_query(ConnectMYSQL,query); cache_get_data(rows, fields); if(rows) { new int_dest[58]; int_dest[0] = cache_get_field_content_int(0, "UserID"); pInfo[playerid][UserID] = int_dest[0]; int_dest[1] = cache_get_field_content_int(0, "scorelevel"); scorelevel[playerid] = int_dest[1]; int_dest[2] = cache_get_field_content_int(0, "maconha"); maconha[playerid] = int_dest[2]; int_dest[3] = cache_get_field_content_int(0, "material"); material[playerid] = int_dest[3]; int_dest[4] = cache_get_field_content_int(0, "sementes"); sementes[playerid] = int_dest[4]; int_dest[5] = cache_get_field_content_int(0, "wanted"); wanted[playerid] = int_dest[5]; int_dest[6] = cache_get_field_content_int(0, "moneybag"); moneybag[playerid] = int_dest[6]; int_dest[7] = cache_get_field_content_int(0, "COPskills"); COPskills[playerid] = int_dest[7]; int_dest[8] = cache_get_field_content_int(0, "CRIMINALskills"); CRIMINALskills[playerid] = int_dest[8]; int_dest[9] = cache_get_field_content_int(0, "PARAMEDICskills"); PARAMEDICskills[playerid] = int_dest[9]; int_dest[10] = cache_get_field_content_int(0, "admin"); admin[playerid] = int_dest[10]; int_dest[11] = cache_get_field_content_int(0, "money"); money[playerid] = int_dest[11]; int_dest[12] = cache_get_field_content_int(0, "bank"); bank[playerid] = int_dest[12];