03.02.2011, 11:51
Код:
CMD:request(playerid, params[]) { new id,name[MAX_PLAYER_NAME],tmp[128],string[128]; if(sscanf(params,"i",id)) return SendClientMessage(playerid, red, "USAGE:/request [org]"); GetPlayerName(playerid, name, sizeof(name)); new query[128]; format(query, sizeof(query), "SELECT * FROM orgs WHERE ID=%d",id); mysql_query(query); mysql_store_result(); new row[128]; new field[3][32]; mysql_fetch_row_format(row, "|"); explode(row, field, "|"); tmp[127]=strval(field[1]); mysql_free_result(); new query1[128]; format(query1,sizeof(query1), "UPDATE ostats SET req=%d WHERE Name='%s'",id,name); mysql_query(query1); format(string, sizeof(string), "~%s is requesting to join %s.",name,tmp[127]); SendClientMessageToAll(COLOR_ORANGE, string); return 1; }