17.02.2015, 12:05
Tbm nгo entendi... entгo no meu caso ficaria assim?
Код:
CMD:fcreate(playerid, params[]) { new string[40], query[128]; if(scorelevel[playerid] < 500) return SendClientMessage(playerid, COLOR_RED, "Vocк precisa ter score/level 500 para criar uma faction"); if(GetPlayerMoney(playerid) < 5000000) return SendClientMessage(playerid, COLOR_RED, "You do not have 5000000"); if(fmembro[playerid] > 0) return SendClientMessage(playerid, COLOR_RED, "Vocк jб tem uma faction"); new localfname[32]; if(sscanf(params,"s", localfname)) return SendClientMessage(playerid, -1, "Use: /fcreate [name]"); format(query, sizeof(query), "INSERT INTO `factions` (`facname`) VALUES ('%s')" , localfname ); mysql_query(ConnectMYSQL,query); new novafacid, consulta; //consulta = cache_get_field_content_int(0, "ID"); novafacid = consulta; novafacid = mysql_insert_id(); fmembro[playerid] = novafacid; fcargo[playerid] = 5; GivePlayerMoney(playerid,-5000000); new facid = fmembro[playerid]; FactionInfo[facid][facname] = localfname; format(string, sizeof(string), "%s (id:%i) criada! (/fhelp)", FactionInfo[facid][facname], novafacid ); SendClientMessage(playerid, COLOR_GREEN, string); return 1; }