19.06.2011, 07:59
Код:
CMD:register(playerid, params[]) { if(pInfo[playerid][pLogged] == 1){return 1;} if(pHaveAcc[playerid] == 1){return 1;} if(isnull(params)){return SendClientMessage(playerid, COLOR_GREY, "Please num /register [password]");} new query[1024]; new sqlusername[64]; new sqlpassword[512]; mysql_real_escape_string(GetName(playerid), sqlusername); mysql_real_escape_string(params, sqlpassword); format(query, sizeof(query), "INSERT INTO `accounts` (name, password, skin, level, moneys, team, rank,\ job, mats, drugs, driving, flying, sailling, weapons, health, armour, wanted, jailed, jailtime,\ spawnx, spawny, spawnz, interior, weapon1, weapon2, weapon3, weapon4) VALUES ('%s', MD5('%s'),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)", sqlusername,sqlpassword); mysql_query(query); pInfo[playerid][pLogged] = 1; SpawnPlayer(playerid); new string[128]; format(string,sizeof(string),"%s you can login on!",GetName(playerid)); SendClientMessage(playerid,COLOR_BLUE,string); return 1; }